Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -1522,10 +1522,28 @@ (set! res count)) ;; select * from tests where run_id=1 and uname = 'n/a' and item_path=''; (db:get-db dbstruct run-id) "SELECT count(id) FROM tests WHERE state in ('RUNNING','LAUNCHED','REMOTEHOSTSTART') AND run_id=? AND NOT (uname = 'n/a' AND item_path = '');" run-id) res)) + ;; override states to count with list of strings. +;; +(define (db:get-count-tests-running-for-run-id -blah db run-id states) + (let ((res 0) + (sqrystr (conc "SELECT count(id) FROM tests WHERE state in ('" + (if states + (string-intersperse states "','") + "RUNNING','LAUNCHED','REMOTEHOSTSTART") + "') AND run_id=? AND NOT (uname = 'n/a' AND item_path = '');"))) + (sqlite3:for-each-row + (lambda (count) + (set! res count)) ;; select * from tests where run_id=1 and uname = 'n/a' and item_path=''; + db + sqrystr run-id) + ;; "SELECT count(id) FROM tests WHERE state in ('RUNNING','LAUNCHED','REMOTEHOSTSTART') AND run_id=? AND NOT (uname = 'n/a' AND item_path = '');" run-id) + res)) + + (define (db:get-count-tests-running-in-jobgroup dbstruct run-id jobgroup) (if (not jobgroup) 0 ;; (let ((res 0) (testnames '())) Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -1240,11 +1240,12 @@ ;;====================================================================== ;; Wait on a run to complete ;;====================================================================== -(if (args:get-arg "-run-wait") +(if (and (args:get-arg "-run-wait") + (not (args:get-arg "-runtests"))) ;; run-wait is built into runtests now (begin (if (not (launch:setup-for-run)) (begin (debug:print 0 "Failed to setup, exiting") (exit 1))) Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -1034,12 +1034,20 @@ ((not (null? reg)) ;; could we get here with leftovers? (debug:print-info 0 "Have leftovers!") (loop (car reg)(cdr reg) '() reruns)) (else (debug:print-info 4 "Exiting loop with...\n hed=" hed "\n tal=" tal "\n reruns=" reruns)) - ))) ;; LET* ((test-record - + )) + ;; now *if* -run-wait we wait for all tests to be done + (let loop ((num-running (cdb:remote-run db:get-count-tests-running-for-run-id #f run-id #f))) + (if (and (args:get-arg "-run-wait") + (> num-running 0)) + (begin + (debug:print-info 0 "-run-wait specified, waiting on " num-running " tests in RUNNING, REMOTEHOSTSTART or LAUNCHED state.") + (thread-sleep! 15) + (loop (cdb:remote-run db:get-count-tests-running-for-run-id #f run-id #f))))) + ) ;; LET* ((test-record ;; we get here on "drop through". All done! (debug:print-info 1 "All tests launched"))) (define (runs:calc-fails prereqs-not-met) (filter (lambda (test) Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -58,11 +58,11 @@ @echo Run all_toplevel and all waitons cd fullrun;$(MEGATEST) -preclean -runtests all_toplevel -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_c test4 : cleanprep @echo "WARNING: No longer running fullprep, test converage may be lessened" - cd fullrun;time $(MEGATEST) -debug $(DEBUG) -runtests % -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_b -m "This is a comment specific to a run" -v $(LOGGING) + cd fullrun;time $(MEGATEST) -debug $(DEBUG) -run-wait -runtests % -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_b -m "This is a comment specific to a run" -v $(LOGGING) test4a : cleanprep cd fullrun;time $(MEGATEST) -debug $(DEBUG) -preclean -runtests all_toplevel -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_b -m "This is a comment specific to a run" -v $(LOGGING) # NOTE: Only one instance can be a server Index: tests/fdktestqa/fdk.config ================================================================== --- tests/fdktestqa/fdk.config +++ tests/fdktestqa/fdk.config @@ -1,21 +1,21 @@ [fields] SYSTEM TEXT RELEASE TEXT -[pre-launch-env-overrides] +[env-override] MAX_ALLOWED_LOAD 200 [setup] # Adjust max_concurrent_jobs to limit how much you load your machines # max_concurrent_jobs 150 -max_concurrent_jobs 500 +max_concurrent_jobs 150 # This is your link path, you can move it but it is generally better to keep it stable linktree #{shell readlink -f #{getenv PWD}/../simplelinks} [include testqa/configs/megatest.abc.config] +timeout 0.025 [server] timeout 1 - Index: tests/fdktestqa/testqa/configs/megatest.abc.config ================================================================== --- tests/fdktestqa/testqa/configs/megatest.abc.config +++ tests/fdktestqa/testqa/configs/megatest.abc.config @@ -3,8 +3,7 @@ state start end completed # Job tools are more advanced ways to control how your jobs are launched [jobtools] useshell yes -launcher nbfake [include megatest.def.config]