Index: api.scm ================================================================== --- api.scm +++ api.scm @@ -127,11 +127,11 @@ ;; (serialize payload) (api:unregister-thread (current-thread)) result))) -(define api:tcp-dispatch-request-make-handler api:tcp-dispatch-request-make-handler-new) +(define api:tcp-dispatch-request-make-handler api:tcp-dispatch-request-make-handler-old) ;; choose -old or -new (define *api-halt-writes* #f) (define (api:dispatch-request dbstruct cmd run-id params) (if (not *no-sync-db*) Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -977,10 +977,11 @@ (case (rmt:transport-mode) ((tcp) (let* ((timeout (server:expiration-timeout))) (debug:print 0 *default-log-port* "INFO: megatest -server starting on " (get-host-name) " for " dbfname " using tcp method with timeout of "timeout) (tt-server-timeout-param timeout) + (api:queue-processor) (thread-start! (make-thread api:print-db-stats "print-db-stats")) (if dbfname (tt:start-server tl #f dbfname api:tcp-dispatch-request-make-handler keys) (begin (debug:print 0 *default-log-port* "ERROR: transport mode is tcp - -db is required.") Index: rmtmod.scm ================================================================== --- rmtmod.scm +++ rmtmod.scm @@ -200,23 +200,28 @@ (define (rmt:get-toplevels-and-incompletes run-id running-deadtime remotehoststart-deadtime) (rmtmod:send-receive 'get-toplevels-and-incompletes run-id (list run-id running-deadtime remotehoststart-deadtime))) +;; .final-status file is two lines: +;; "state" +;; "status" +;; (define (rmt:get-status-from-final-status-file run-dir) (let ((infile (conc run-dir "/.final-status"))) - ;; first verify we are able to write the output file + ;; first verify we are able to read the output file (if (not (file-read-access? infile)) (begin (debug:print 2 *default-log-port* "ERROR: cannot read " infile) (debug:print 2 *default-log-port* "ERROR: run-dir is " run-dir) #f ) (let ((res (with-input-from-file infile read-lines))) (if (null? res) #f - (string-split (car res))))))) + res))))) ;; (string-split (car res))))))) <== I would have preferred a single line STATE STATUS without "'s + ;; (string-split (car res))))))) ;; DUNNO WHICH IS CORRECT ;; select end_time-now from ;; (select testname,item_path,event_time+run_duration as ;; end_time,strftime('%s','now') as now from tests where state in ;; ('RUNNING','REMOTEHOSTSTART','LAUNCHED')); Index: tests.scm ================================================================== --- tests.scm +++ tests.scm @@ -1435,19 +1435,19 @@ (out-dir (db:test-get-rundir test-dat)) (status-file (conc out-dir "/.final-status")) ) ;; first verify we are able to write the output file (if (not (file-write-access? out-dir)) - (debug:print 0 *default-log-port* "ERROR: cannot write .final-status to " out-dir) - (let* - ((outp (open-output-file status-file)) + (debug:print 0 *default-log-port* "ERROR: cannot write .final-status to " out-dir) + (let* ((outp (open-output-file status-file)) (status (db:test-get-status test-dat)) - (state (db:test-get-state test-dat))) - (fprintf outp "~S\n" state) - (fprintf outp "~S\n" status) - (close-output-port outp))))) - + (state (db:test-get-state test-dat))) + (with-output-to-port outp + (lambda () + (print state) ;; printf was putting in ", not sure why but that was a hassle in other contexts + (print status))) + (close-output-port outp))))) ;; summarize test in to a file test-summary.html in the test directory ;; (define (tests:summarize-test run-id test-id) (let* ((test-dat (rmt:get-test-info-by-id run-id test-id))