okami.mom/albedo

git clone https://git.nkp.pet/okami.mom/albedo

Aly Raffauffix(session): use monotonic time for retry deadlines31c9e74

main
714 B15 linesraw
1//// Retry deadlines use monotonic time, which may be negative on the BEAM.
2//// Exact deadline boundaries and the zero sentinel cannot be ordered by E2E.
3
4import albedo/daemon/session_state
5import gleeunit/should
6
7pub fn retry_wait_uses_the_same_deadline_boundary_with_negative_time_test() -> Nil {
8  session_state.retry_pending(-100, -101) |> should.be_true
9  session_state.retry_pending(-100, -100) |> should.be_false
10  session_state.retry_pending(-100, -99) |> should.be_false
11  session_state.retry_pending(100, 99) |> should.be_true
12  session_state.retry_pending(100, 100) |> should.be_false
13  session_state.retry_pending(0, -100) |> should.be_false
14  session_state.retry_pending(0, 100) |> should.be_false
15}