Adds isWaiting to mockClock to remove sleep in testsales
This commit is contained in:
parent
9b7f3f4aaf
commit
47c229311e
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue