Megatest

Check-in [8f71552216]
Login
Overview
Comment:For the runner loop apply small delay on too-rapid calls, then more delay when no tests are launching
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v2.0001
Files: files | file ages | folders
SHA1: 8f71552216d3ae7743e36a256eed4d93e778aa95
User & Date: matt on 2022-01-26 18:31:47
Other Links: branch diff | manifest | tags
Context
2022-01-27
15:54
fixed couple issues in reading config files check-in: f82d420370 user: mrwellan tags: v2.0001
2022-01-26
18:31
For the runner loop apply small delay on too-rapid calls, then more delay when no tests are launching check-in: 8f71552216 user: matt tags: v2.0001
18:20
Wait five seconds after launching a test before throttling the runner loop. check-in: 682af2eb81 user: matt tags: v2.0001
Changes

Modified runsmod.scm from [4424067f1c] to [727372ff23].

249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
(define *too-soon-delays* (make-hash-table))
(define *last-test-launch* 0)

;; to-soon delay, when matching event happened in less than dseconds delay wseconds
;;
(define (runs:too-soon-delay key dseconds wseconds)
  (let* ((last-time (hash-table-ref/default *too-soon-delays* key #f)))
    (if (and (> (- (current-seconds) *last-test-launch*) 5) ;; be aggressive for five seconds after starting a test
	     last-time
	     (< (- (current-seconds) last-time) dseconds))
	(begin
	  (debug:print-info 4 *default-log-port* "Whoa, slow down there ... "key" has been too recently seen.")
	  (thread-sleep! wseconds)))
    (hash-table-set! *too-soon-delays* key (current-seconds))))

(define (runs:can-run-more-tests runsdat run-id jobgroup max-concurrent-jobs)







<
|







249
250
251
252
253
254
255

256
257
258
259
260
261
262
263
(define *too-soon-delays* (make-hash-table))
(define *last-test-launch* 0)

;; to-soon delay, when matching event happened in less than dseconds delay wseconds
;;
(define (runs:too-soon-delay key dseconds wseconds)
  (let* ((last-time (hash-table-ref/default *too-soon-delays* key #f)))

    (if (and last-time
	     (< (- (current-seconds) last-time) dseconds))
	(begin
	  (debug:print-info 4 *default-log-port* "Whoa, slow down there ... "key" has been too recently seen.")
	  (thread-sleep! wseconds)))
    (hash-table-set! *too-soon-delays* key (current-seconds))))

(define (runs:can-run-more-tests runsdat run-id jobgroup max-concurrent-jobs)
1482
1483
1484
1485
1486
1487
1488

1489

1490
1491
1492
1493
1494
1495
1496
			   testmode:    testmode
			   newtal:      newtal
			   itemmaps:    itemmaps
			   ;; prereqs-not-met: prereqs-not-met
			   )))
	(runs:dat-regfull-set! runsdat regfull)


	(runs:too-soon-delay (conc "loop delay " hed) 1 1)

	
	(if (> num-running 0)
            (set! last-time-some-running (current-seconds)))

        (if (> (current-seconds)(+ last-time-some-running (or (configf:lookup *configdat* "setup" "give-up-waiting") 36000)))
            (hash-table-set! *max-tries-hash* tfullname (+ (hash-table-ref/default *max-tries-hash* tfullname 0) 1)))
	;; (debug:print 0 *default-log-port* "max-tries-hash: " (hash-table->alist *max-tries-hash*))







>
|
>







1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
			   testmode:    testmode
			   newtal:      newtal
			   itemmaps:    itemmaps
			   ;; prereqs-not-met: prereqs-not-met
			   )))
	(runs:dat-regfull-set! runsdat regfull)

	(if (> (- (current-seconds) *last-test-launch*) 5)        ;; be pretty aggressive for five seconds after
	    (runs:too-soon-delay (conc "loop delay " hed) 1 1)    ;; starting a test then apply more delay
	    (runs:too-soon-delay (conc "loop delay " hed) 1 0.1)) 
	
	(if (> num-running 0)
            (set! last-time-some-running (current-seconds)))

        (if (> (current-seconds)(+ last-time-some-running (or (configf:lookup *configdat* "setup" "give-up-waiting") 36000)))
            (hash-table-set! *max-tries-hash* tfullname (+ (hash-table-ref/default *max-tries-hash* tfullname 0) 1)))
	;; (debug:print 0 *default-log-port* "max-tries-hash: " (hash-table->alist *max-tries-hash*))