Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -1223,22 +1223,22 @@ ;; (db:delay-if-busy) (sqlite3:execute (db:get-db dbstruct #f) "INSERT INTO access_log (user,accessed,args) VALUES(?,strftime('%s','now'),?);" user (conc newlockval " " run-id)) (debug:print-info 1 "" newlockval " run number " run-id))) -(define (db:set-run-status db run-id status msg) - ;; (db:delay-if-busy) - (if msg - (sqlite3:execute db "UPDATE runs SET status=?,comment=? WHERE id=?;" status msg run-id) - (sqlite3:execute db "UPDATE runs SET status=? WHERE id=?;" status run-id))) +(define (db:set-run-status dbstruct run-id status msg) + (let ((db (db:get-db dbstruct #f))) + (if msg + (sqlite3:execute db "UPDATE runs SET status=?,comment=? WHERE id=?;" status msg run-id) + (sqlite3:execute db "UPDATE runs SET status=? WHERE id=?;" status run-id)))) -(define (db:get-run-status db run-id) +(define (db:get-run-status dbstruct run-id) (let ((res "n/a")) (sqlite3:for-each-row (lambda (status) (set! res status)) - db + (db:get-db dbstruct #f) "SELECT status FROM runs WHERE id=?;" run-id) res)) ;;====================================================================== Index: launch.scm ================================================================== --- launch.scm +++ launch.scm @@ -724,12 +724,12 @@ (if (not remote-megatest)(set! remote-megatest local-megatest)) ;; "megatest")) (set! mt-bindir-path (pathname-directory remote-megatest)) (if launcher (set! launcher (string-split launcher))) ;; set up the run work area for this test (if (and (args:get-arg "-preclean") ;; user has requested to preclean for this run - (not (equal? (db:test-get-rundir testinfo) "n/a"))) ;; n/a is a placeholder and thus not a read dir - (begin + (not (member (db:test-get-rundir testinfo)(list "n/a" "/tmp/badname")))) ;; n/a is a placeholder and thus not a read dir + (begin (debug:print-info 0 "attempting to preclean directory " (db:test-get-rundir testinfo) " for test " test-name "/" item-path) (runs:remove-test-directory #f testinfo #t))) ;; remove data only, do not perturb the record (set! diskpath (get-best-disk *configdat*)) (if diskpath (let ((dat (create-work-area run-id run-info keyvals test-id test-path diskpath test-name itemdat))) Index: rmt.scm ================================================================== --- rmt.scm +++ rmt.scm @@ -321,11 +321,11 @@ ;; set/get status (define (rmt:get-run-status run-id) (rmt:send-receive 'get-run-status #f (list run-id))) (define (rmt:set-run-status run-id run-status #!key (msg #f)) - (rmt:send-receive 'set-run-status #f (list run-id msg))) + (rmt:send-receive 'set-run-status #f (list run-id run-status msg))) (define (rmt:update-run-event_time run-id) (rmt:send-receive 'update-run-event_time #f (list run-id))) (define (rmt:get-runs-by-patt keys runnamepatt targpatt offset limit) Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -1533,11 +1533,12 @@ (debug:print 0 "WARNING: refusing to remove " run-dir " as it is not empty") (handle-exceptions exn (debug:print 0 "ERROR: Failed to remove directory " run-dir ((condition-property-accessor 'exn 'message) exn) ", attempting to continue") (delete-directory run-dir))) - (if run-dir + (if (and run-dir + (not (member run-dir (list "n/a" "/tmp/badname")))) (debug:print 0 "WARNING: not removing " run-dir " as it either doesn't exist or is not a symlink") (debug:print 0 "NOTE: the run dir for this test is undefined. Test may have already been deleted.")) )) ;; Only delete the records *after* removing the directory. If things fail we have a record (if (not remove-data-only)