Skip to content

Commit f81b7b6

Browse files
Increase lower bound tolerance of future deref timeout test (#1185)
Hi, can you please review to increase the lower bounder tolerance for the `future` `deref` test with a timeout period. It addresses #1184. The samples for the CI test failures suggested that the failures had an error of -4ms, so I've increased the lower boundary to 95ms from 100ms. If this proves to be insufficient, I will further increase it to 90ms. I've also corrected the labelling from `ms` to `s` (for seconds), the unit `perf-counter` returns. I have not included this in the CHANGELOG, since I think is not required. Co-authored-by: ikappaki <[email protected]> Co-authored-by: Chris Rink <[email protected]>
1 parent 841392d commit f81b7b6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tests/basilisp/test_core_fns.lpy

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@
15461546
end (time/perf-counter)
15471547
diff (- end start)]
15481548
(is (= :timed-out ret))
1549-
(is (< 0.1 diff 0.5) (str "deref timeout is outside of [100ms, 500ms] range: " diff "ms")))))
1549+
(is (< 0.1 diff 0.5) (str "deref timeout is outside of [100ms, 500ms] range: " diff "s")))))
15501550

15511551
;;;;;;;;;;;;;
15521552
;; Futures ;;
@@ -1573,8 +1573,14 @@
15731573
end (time/perf-counter)
15741574
diff (- end start)]
15751575
(is (= :timed-out ret))
1576-
(is (< 0.1 diff 0.5) (str "deref timeout outside of [100ms, 500ms] range: " diff "ms"
1577-
" -- :pre " pre " :start " start " :end " end))
1576+
;; The lower bound is set to 95ms instead of 100ms due to an
1577+
;; unexplained discrepancy observed on GitHub CI, where `deref`
1578+
;; returned a few milliseconds before the time-out period
1579+
;; elapsed.
1580+
;;
1581+
;; https://github.com/basilisp-lang/basilisp/issues/1184
1582+
(is (< 0.095 diff 0.5) (str "deref timeout outside of [95ms, 500ms] range: " diff "s"
1583+
" -- :pre " pre " :start " start " :end " end))
15781584
(is (= false (future-cancelled? fut)))
15791585
(is (= false (future-done? fut)))
15801586
;; can't always cancel a sleep-ed Future

0 commit comments

Comments
 (0)