Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -2242,14 +2242,16 @@ ;; set tests with state currstate and status currstatus to newstate and newstatus ;; use currstate = #f and or currstatus = #f to apply to any state or status respectively ;; WARNING: SQL injection risk. NB// See new but not yet used "faster" version below ;; - ;; AND NOT (item_path='' AND testname in (SELECT DISTINCT testname FROM tests WHERE testname=? AND item_path != ''));"))) - ;;(debug:print 0 "QRY: " qry) - ;; (db:delay-if-busy) - +;; AND NOT (item_path='' AND testname in (SELECT DISTINCT testname FROM tests WHERE testname=? AND item_path != ''));"))) +;; (debug:print 0 "QRY: " qry) +;; (db:delay-if-busy) +;; +;; NB// This call only operates on toplevel tests. Consider replacing it with more general call +;; (define (db:set-tests-state-status dbstruct run-id testnames currstate currstatus newstate newstatus) (for-each (lambda (testname) (let ((qry (conc "UPDATE tests SET state=?,status=? WHERE " (if currstate (conc "state='" currstate "' AND ") "") (if currstatus (conc "status='" currstatus "' AND ") "") @@ -2257,12 +2259,13 @@ (db:with-db dbstruct run-id #t (lambda (db) - (sqlite3:execute db qry newstate newstatus run-id testname) - (mt:process-triggers run-id test-id newstate newstatus) + (let ((test-id (db:get-test-id dbstruct run-id testname ""))) + (sqlite3:execute db qry newstate newstatus run-id testname) + (if test-id (mt:process-triggers run-id test-id newstate newstatus))) )))) testnames)) ;; speed up for common cases with a little logic ;; NB// Ultimately this will be deprecated in deference to mt:test-set-state-status-by-id Index: tests/fullrun/megatest.config ================================================================== --- tests/fullrun/megatest.config +++ tests/fullrun/megatest.config @@ -145,11 +145,11 @@ # RUNDEAD [system exit 56] [server] # force use of server always -required yes +# required yes # Use http instead of direct filesystem access transport http # transport fs # transport nmsg @@ -161,20 +161,19 @@ port 9080 # This server will keep running this number of hours after last access. # Three minutes is 0.05 hours # timeout 0.025 -timeout 0.061 +timeout 0.01 # faststart; unless no, start server but proceed with writes until server started -faststart no -# faststart yes +# faststart no +faststart yes # Start server when average query takes longer than this # server-query-threshold 55500 server-query-threshold 1000 -timeout 0.01 # daemonize yes # hostname #{scheme (get-host-name)} ## disks are: Index: tests/unittests/runs.scm ================================================================== --- tests/unittests/runs.scm +++ tests/unittests/runs.scm @@ -320,10 +320,16 @@ (test "server stop" #f (let ((hostname (car *runremote*)) (port (cadr *runremote*))) (tasks:kill-server #t hostname port server-pid 'http) (open-run-close tasks:get-best-server tasks:open-db))) +;;====================================================================== +;; M O R E R E M O T E C A L L S +;;====================================================================== + +(test #f #f (rmt:set-tests-state-status 1 '("runfirst") "RUNNING" "WARN" "COMPLETED" "FAIL")) + ;; (cdb:kill-server *runremote*) ;; (thread-join! th1 th2 th3) ;; ADD ME!!!! (db:get-prereqs-not-met *db* 1 '("runfirst") "" mode: 'normal)