Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -836,20 +836,24 @@ (define runs:nothing-left-in-queue-count 0) (define (runs:lazy-get-prereqs-not-met testdat run-id waitons hed item-path #!key (mode '(normal))(itemmaps #f)) ;; mode: testmode itemmaps: itemmaps) (if (< (- (current-seconds) (runs:testdat-last-update testdat)) 10) ;; only refresh for this test if it has been at least 10 seconds (begin - (debug:print 0 *default-log-port* "last-update=" (runs:testdat-last-update testdat) "(current-seconds)=" (current-seconds)) + ;; (debug:print 0 *default-log-port* "last-update=" (runs:testdat-last-update testdat) "(current-seconds)=" (current-seconds)) (runs:testdat-prereqs-not-met testdat)) ;; (rmt:get-prereqs-not-met 46 '("r1") "y1" "" mode: '(itemmatch) itemmaps: #f) (let* ((res (let ((res (rmt:get-prereqs-not-met run-id waitons hed item-path mode: mode itemmaps: itemmaps))) + (debug:print 4 *default-log-port* "Get prereqs for " hed ", have " (length res) + " prereqs. last-update=" (runs:testdat-last-update testdat) " current-seconds=" (current-seconds) + " delta=" (- (current-seconds) (runs:testdat-last-update testdat))) (if (list? res) res (begin (debug:print 0 *default-log-port* "ERROR: rmt:get-prereqs-not-met returned non-list!\n" - " res=" res " run-id=" run-id " waitons=" waitons " hed=" hed " item-path=" item-path " testmode=" mode " itemmaps=" itemmaps) + " res=" res " run-id=" run-id " waitons=" waitons " hed=" hed + " item-path=" item-path " testmode=" mode " itemmaps=" itemmaps) '()))))) (runs:testdat-prereqs-not-met-set! testdat res) (runs:testdat-last-update-set! testdat (current-seconds)) res))) @@ -1466,11 +1470,13 @@ ;; when the min is > max-allowed and none running then force exit ;; (define *max-tries-hash* (make-hash-table)) (define (runs:pretty-long-list lst) - (if (> (length lst) 8)(append (take lst 3)(list "...")) lst)) + (if (> (length lst) 8)(append (take lst 3)(list "...")) lst)) + +(define *runs-testdat-cache* (make-hash-table)) ;; full/testname => testdat ;;====================================================================== ;; runs:run-tests-queue is called by runs:run-tests ;;====================================================================== ;; @@ -1590,25 +1596,43 @@ '()))) (waitons (delete-duplicates (append (tests:testqueue-get-waitons test-record) extra-waits) equal?)) (newtal (append tal (list hed))) (regfull (>= (length reg) reglen)) (num-running (rmt:get-count-tests-running-for-run-id run-id #t)) ;; fastmode=yes - (testdat (make-runs:testdat - hed: hed - tal: tal - reg: reg - reruns: reruns - test-record: test-record - test-name: test-name - item-path: item-path - jobgroup: jobgroup - waitons: waitons - testmode: testmode - newtal: newtal - itemmaps: itemmaps - ;; prereqs-not-met: prereqs-not-met - ))) + (testdat (let ((oldtestdat (hash-table-ref/default *runs-testdat-cache* tfullname #f))) + (if oldtestdat + (begin + (runs:testdat-hed-set! oldtestdat hed) + (runs:testdat-tal-set! oldtestdat tal) + (runs:testdat-reg-set! oldtestdat reg) + (runs:testdat-reruns-set! oldtestdat reruns) + (runs:testdat-test-record-set! oldtestdat test-record) + (runs:testdat-newtal-set! oldtestdat newtal) + + (if (not (equal? (runs:testdat-waitons oldtestdat) waitons)) + (debug:print 0 *default-log-port* " waitons changed for runs:testdat")) + (if (not (equal? (runs:testdat-itemmaps oldtestdat) itemmaps)) + (debug:print 0 *default-log-port* " itemmaps changed for runs:testdat")) + + oldtestdat) + (let ((newtestdat (make-runs:testdat + hed: hed + tal: tal + reg: reg + reruns: reruns + test-record: test-record + test-name: test-name + item-path: item-path + jobgroup: jobgroup + waitons: waitons + testmode: testmode + newtal: newtal + itemmaps: itemmaps + ;; prereqs-not-met: prereqs-not-met + ))) + (hash-table-set! *runs-testdat-cache* tfullname newtestdat) + newtestdat))))) (runs:dat-regfull-set! runsdat regfull) (if (> num-running 0) (set! last-time-some-running (current-seconds)))