diff --git a/tests/codex/helpers/mockclock.nim b/tests/codex/helpers/mockclock.nim index ada449f9..75a251c9 100644 --- a/tests/codex/helpers/mockclock.nim +++ b/tests/codex/helpers/mockclock.nim @@ -40,3 +40,6 @@ method waitUntil*(clock: MockClock, time: SecondsSince1970) {.async.} = let future = newFuture[void]() clock.waiting.add(Waiting(until: time, future: future)) await future + +proc isWaiting*(clock: MockClock): bool = + clock.waiting.len > 0 diff --git a/tests/codex/sales/testsales.nim b/tests/codex/sales/testsales.nim index 3d142d16..b66d973f 100644 --- a/tests/codex/sales/testsales.nim +++ b/tests/codex/sales/testsales.nim @@ -190,7 +190,7 @@ asyncchecksuite "Sales": proc allowRequestToStart {.async.} = # wait until we're in initialproving state - await sleepAsync(10.millis) + check eventually clock.isWaiting # it won't start proving until the next period await clock.advanceToNextPeriod(market)