Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -1294,11 +1294,11 @@ ;; Roll up test_data pass/fail results ;; look at the test_data status field, ;; if all are pass (any case) and the test status is PASS or NULL or '' then set test status to PASS. ;; if one or more are fail (any case) then set test status to PASS, non "pass" or "fail" are ignored (define (db:test-data-rollup db test-id status) - (let ((tdb (db:open-test-db-by-test-id db test-id)) + (let ((tdb (open-run-close db:open-test-db-by-test-id db test-id)) (fail-count 0) (pass-count 0)) (if tdb (begin (sqlite3:for-each-row @@ -1314,11 +1314,11 @@ ;; Now rollup the counts to the central megatest.db (rdb:pass-fail-counts test-id fail-count pass-count) ;; (sqlite3:execute db "UPDATE tests SET fail_count=?,pass_count=? WHERE id=?;" ;; fail-count pass-count test-id) - (thread-sleep! 1) ;; play nice with the queue by ensuring the rollup is at least one second later than the set + (thread-sleep! 0.01) ;; play nice with the queue by ensuring the rollup is at least 10ms later than the set ;; if the test is not FAIL then set status based on the fail and pass counts. (rdb:test-rollup-iterated-pass-fail test-id) ;; (sqlite3:execute ;; db ;;; NOTE: Should this be WARN,FAIL? A WARN is not a FAIL????? BUG FIXME @@ -1630,11 +1630,18 @@ (define (rdb:test-set-status-state test-id status state msg) (if *runremote* (let ((host (vector-ref *runremote* 0)) (port (vector-ref *runremote* 1))) - ((rpc:procedure 'cdb:test-set-status-state host port) test-id status state msg)) + (handle-exceptions + exn + (begin + (debug:print 0 "EXCEPTION: rpc call failed?") + (debug:print 0 " " ((condition-property-accessor 'exn 'message) exn)) + (print-call-chain) + (cdb:test-set-status-state test-id status state msg)) + ((rpc:procedure 'cdb:test-set-status-state host port) test-id status state msg))) (cdb:test-set-status-state test-id status state msg))) (define (rdb:test-rollup-iterated-pass-fail test-id) (if *runremote* (let ((host (vector-ref *runremote* 0)) Index: server.scm ================================================================== --- server.scm +++ server.scm @@ -169,11 +169,12 @@ exn (begin (print "Failed to bind to port " (rpc:default-server-port) ", trying next port") (server:find-free-port-and-open (+ port 1))) (rpc:default-server-port port) - (tcp-listen (rpc:default-server-port)))) + (tcp-read-timeout 120000) + (tcp-listen (rpc:default-server-port) ))) (define (server:client-setup) (if *runremote* (begin (debug:print 0 "ERROR: Attempt to connect to server but already connected") Index: tests.scm ================================================================== --- tests.scm +++ tests.scm @@ -140,17 +140,16 @@ (if waived (set! real-status "WAIVED")) (debug:print 4 "real-status " real-status ", waived " waived ", status " status) ;; update the primary record IF state AND status are defined (if (and state status) - ;; (rdb:open-run-close 'cdb:test-set-status-state #f test-id real-status state)) ;; this one works (rdb:test-set-status-state test-id real-status state #f)) ;; if status is "AUTO" then call rollup (note, this one modifies data in test ;; run area, do not rpc it (yet) (if (and test-id state status (equal? status "AUTO")) - (open-run-close db:test-data-rollup db test-id status)) + (db:test-data-rollup #f test-id status)) ;; add metadata (need to do this way to avoid SQL injection issues) ;; :first_err ;; (let ((val (hash-table-ref/default otherdat ":first_err" #f)))