Index: rmt.scm ================================================================== --- rmt.scm +++ rmt.scm @@ -108,12 +108,12 @@ ;; These should not require run-id but it is more consistent to have it. ;; run-id can theoretically be #f but how to handle that is not yet done. (define (rmt:get-key-val-pairs run-id) (rmt:send-receive 'get-key-val-pairs run-id (list run-id))) -(define (rmt:get-keys run-id) - (rmt:send-receive 'get-keys run-id '())) +(define (rmt:get-keys) + (rmt:send-receive 'get-keys #f '())) ;;====================================================================== ;; T E S T S ;;====================================================================== @@ -227,26 +227,29 @@ (define (rmt:delete-run run-id) (rmt:send-receive 'delete-run run-id (list run-id))) (define (rmt:delete-old-deleted-test-records) - (rmt:send-receive 'delete-old-deleted-test-records '())) + (rmt:send-receive 'delete-old-deleted-test-records #f '())) (define (rmt:get-runs runpatt count offset keypatts) - (rmt:send-receive 'get-runs (list runpatt count offset keypatts))) + (rmt:send-receive 'get-runs #f (list runpatt count offset keypatts))) (define (rmt:get-runs runpatt count offset keypatts) - (rmt:send-receive 'get-runs (list runpatt count offset keypatts))) + (rmt:send-receive 'get-runs #f (list runpatt count offset keypatts))) (define (rmt:get-all-run-ids) (rmt:send-receive 'get-all-run-ids #f '())) (define (rmt:lock/unlock-run run-id lock unlock user) - (rmt:send-receive 'lock/unlock-run (list run-id lock unlock user))) + (rmt:send-receive 'lock/unlock-run #f (list run-id lock unlock user))) (define (rmt:update-run-event_time run-id) - (rmt:send-receive 'update-run-event_time (list run-id))) + (rmt:send-receive 'update-run-event_time #f (list run-id))) + +(define (rmt:get-runs-by-patt keys runnamepatt targpatt offset limit) + (rmt:send-receive 'get-runs-by-patt #f (list keys runnamepatt targpatt offset limit))) ;;====================================================================== ;; S T E P S ;;====================================================================== Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -93,11 +93,11 @@ (define (set-megatest-env-vars run-id #!key (inkeys #f)(inrunname #f)(inkeyvals #f)) (let* ((target (or (args:get-arg "-reqtarg") (args:get-arg "-target") (get-environment-variable "MT_TARGET"))) - (keys (if inkeys inkeys (rmt:get-keys run-id))) + (keys (if inkeys inkeys (rmt:get-keys))) (keyvals (if inkeyvals inkeyvals (keys:target->keyval keys target))) (vals (hash-table-ref/default *env-vars-by-run-id* run-id #f))) ;; get the info from the db and put it in the cache (if (not vals) (let ((ht (make-hash-table))) Index: tasks.scm ================================================================== --- tasks.scm +++ tasks.scm @@ -202,21 +202,30 @@ "SELECT id,interface,port,pubport,transport,pid,hostname FROM servers WHERE strftime('%s','now')-heartbeat < 10 AND mt_version=? AND run_id=? AND state='running' ORDER BY start_time DESC LIMIT 1;" (common:version-signature) run-id) res)) + +;; (define (tasks:get-all-servers mdb) +;; (let ((res '())) +;; (sqlite3:for-each-row +;; (lambda (id interface port pubport transport pid hostname) +;; (set! res (cons (vector id interface port pubport transport pid hostname) res))) +;; mdb +;; "SELECT id,interface,port,pubport,transport,pid,hostname FROM servers +;; WHERE strftime('%s','now')-heartbeat < 10 +;; AND mt_version=? +;; ORDER BY start_time DESC;" (common:version-signature)) +;; res)) (define (tasks:get-all-servers mdb) - (let ((res #f)) + (let ((res '())) (sqlite3:for-each-row - (lambda (id interface port pubport transport pid hostname) - (set! res (cons (vector id interface port pubport transport pid hostname) res))) + (lambda (id pid hostname interface port pubport start-time priority state mt-version last-update transport) + (set! res (cons (vector id pid hostname interface port pubport start-time priority state mt-version last-update transport) res))) mdb - "SELECT id,interface,port,pubport,transport,pid,hostname FROM servers - WHERE strftime('%s','now')-heartbeat < 10 - AND mt_version=? - ORDER BY start_time DESC;" (common:version-signature)) + "SELECT id,pid,hostname,interface,port,pubport,start_time,priority,state,mt_version,strftime('%s','now')-heartbeat AS last_update,transport FROM servers ORDER BY start_time DESC;") res)) (define (tasks:kill-server status hostname port pid transport) (debug:print-info 1 "Removing defunct server record for " hostname ":" port) (if port Index: tests/fullrun/megatest.config ================================================================== --- tests/fullrun/megatest.config +++ tests/fullrun/megatest.config @@ -123,7 +123,7 @@ [include config/mt_include_2.config] [include #{getenv USER}_testing.config] [jobgroups] -sqlite3 3 -blockz 5 +sqlite3 6 +blockz 10