Skip to content

Commit fa526a8

Browse files
author
mrwellan
committed
Changed backoff rate and recover rate when no jobs can run but there are still jobs to run
1 parent d7dfe9f commit fa526a8

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

megatest-version.scm

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33

44
(declare (unit megatest-version))
55

6-
(define megatest-version 1.5211)
6+
(define megatest-version 1.5212)
77

mockup-cached-writes.scm

+17-8
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,29 @@
33
(define (make-cached-writer the-db)
44
(let ((db the-db)
55
(queue '()))
6-
(lambda (cacheable . qry-params)
6+
(lambda (cacheable . qry-params) ;; fn qry
77
(if cacheable
8-
(set! queue (cons qry-params queue))
8+
(begin
9+
(set! queue (cons qry-params queue))
10+
(call/cc))
911
(begin
1012
(print "Starting transaction")
1113
(for-each
1214
(lambda (queue-item)
13-
(print "WRITE to " db ": " queue-item))
15+
(let ((fn (car queue-item))
16+
(qry (cdr queue-item)))
17+
(print "WRITE to " db ": " qry)
18+
)
1419
(reverse queue))
1520
(print "End transaction")
1621
(print "READ from " db ": " qry-params))))))
1722

18-
(define a (make-cached-writer "the db"))
19-
(a #t "insert abc")
20-
(a #t "insert def")
21-
(a #t "insert hij")
22-
(a #f "select foo")
23+
(define *cw* (make-cached-writer "the db"))
24+
25+
(define (dbcall cacheable query)
26+
(*cw* cacheable query))
27+
28+
(dbcall #t "insert abc")
29+
(dbcall #t "insert def")
30+
(dbcall #t "insert hij")
31+
(dbcall #f "select foo")

runs.scm

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
(define *last-num-running-tests* 0)
123123
(define *runs:can-run-more-tests-delay* 0)
124124
(define (runs:shrink-can-run-more-tests-delay)
125-
(set! *runs:can-run-more-tests-delay* (/ *runs:can-run-more-tests-delay* 2)))
125+
(set! *runs:can-run-more-tests-delay* 0)) ;; (/ *runs:can-run-more-tests-delay* 2)))
126126

127127
(define (runs:can-run-more-tests test-record)
128128
(thread-sleep! *runs:can-run-more-tests-delay*)
@@ -142,7 +142,7 @@
142142
(if (and (> (+ num-running num-running-in-jobgroup) 0)
143143
(< *runs:can-run-more-tests-delay* 10))
144144
(begin
145-
(set! *runs:can-run-more-tests-delay* (+ *runs:can-run-more-tests-delay* 0.1))
145+
(set! *runs:can-run-more-tests-delay* (+ *runs:can-run-more-tests-delay* 1)) ;; 0.1))
146146
(debug:print-info 14 "can-run-more-tests-delay: " *runs:can-run-more-tests-delay*)))
147147
(if (not (eq? *last-num-running-tests* num-running))
148148
(begin

0 commit comments

Comments
 (0)