Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -281,18 +281,18 @@ (sqlite3:finalize! db #t) (vector-set! *task-db* 0 #f)))))) "Cleanup db exit thread")) (th2 (make-thread (lambda () (debug:print 4 "Attempting clean exit. Please be patient and wait a few seconds...") (if no-hurry - (thread-sleep! 0.1) ;; give the clean up few seconds to do it's stuff - (thread-sleep! 4)) + (thread-sleep! 5) ;; give the clean up few seconds to do it's stuff + (thread-sleep! 2)) (debug:print 4 " ... done") ) "clean exit"))) - (thread-start! th2) (thread-start! th1) - (thread-join! th2)))) + (thread-start! th2) + (thread-join! th1)))) (define (std-signal-handler signum) ;; (signal-mask! signum) (set! *time-to-exit* #t) (debug:print 0 "ERROR: Received signal " signum " exiting promptly") Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -127,10 +127,11 @@ -show-runconfig : dump the internal representation of the runconfigs.config file -dumpmode json : dump in json format instead of sexpr -show-cmdinfo : dump the command info for a test (run in test environment) -section sectionName -var varName : for config and runconfig lookup value for sectionName varName + -changed-runs-since N : get list of runs changed since time N (Unix seconds) Misc -start-dir path : switch to this directory before running megatest -rebuild-db : bring the database schema up to date -cleanup-db : remove any orphan records, vacuum the db @@ -243,10 +244,11 @@ "-ping" "-refdb2dat" "-o" "-log" "-archive" + "-changed-runs-since" ) (list "-h" "-help" "--help" "-version" "-force" "-xterm" @@ -987,10 +989,32 @@ tests))))) runs) (if (eq? dmode 'json)(json-write data)) (set! *didsomething* #t)))) +(if (and (args:get-arg "-changed-runs-since") + (launch:setup-for-run)) + (let* ((since-time (string->number (args:get-arg "-changed-runs-since"))) + (dbdir (db:dbfile-path #f)) ;; (configf:lookup *configdat* "setup" "dbdir")) + (alldbs (glob (conc dbdir "/[0-9]*.db"))) + (changed (filter (lambda (dbfile) + (> (file-modification-time dbfile) since-time)) + alldbs)) + (run-ids (delete-duplicates + (map (lambda (dbfile) + (let* ((res (string-match ".*\\/(\\d)*\\.db" dbfile))) + (if res + (string->number (cadr res)) + (begin + (debug:print 2 "ERROR: Failed to process " dbfile " for run-id") + 0)))) + changed)))) + ;; (rmt:get-tests-for-runs-mindata run-ids testpatt states status not-in) + (print (sort run-ids <)) + (set! *didsomething* #t))) + + ;;====================================================================== ;; full run ;;====================================================================== ;; get lock in db for full run for this directory