Box-and-client speed test
This commit is contained in:
parent
290170f450
commit
3a857db4b9
|
@ -931,4 +931,24 @@
|
||||||
"box: terminating"
|
"box: terminating"
|
||||||
"client: box has gone"))
|
"client: box has gone"))
|
||||||
|
|
||||||
|
(let ((N 25000))
|
||||||
|
(test-case
|
||||||
|
;; Box-and-client speed test
|
||||||
|
[(message-struct set-box (new-value))
|
||||||
|
(assertion-struct box-state (value))
|
||||||
|
(spawn (field [current-value 0])
|
||||||
|
(assert (box-state (current-value)))
|
||||||
|
(stop-when-true (= (current-value) N))
|
||||||
|
(on (message (set-box $new-value))
|
||||||
|
(current-value new-value)))
|
||||||
|
(spawn (stop-when (retracted (observe (set-box _))))
|
||||||
|
(on (asserted (box-state $v))
|
||||||
|
(send! (set-box (+ v 1)))))]
|
||||||
|
no-crashes
|
||||||
|
(expected-output)
|
||||||
|
(it "should be reasonably quick"
|
||||||
|
(log-info "Rough box-and-client speed: ~a cycles in ~a ms = ~a Hz"
|
||||||
|
N
|
||||||
|
(test-run-time)
|
||||||
|
(/ N (/ (test-run-time) 1000.0))))))
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue