sales: fix flaky test

This commit is contained in:
Mark Spanbroek 2024-03-03 07:11:19 +01:00
parent 769e67e466
commit 1049698336
No known key found for this signature in database
GPG Key ID: FBE3E9548D427C00
1 changed files with 3 additions and 1 deletions

View File

@ -42,7 +42,9 @@ asyncchecksuite "sales state 'proving'":
proc advanceToNextPeriod(market: Market) {.async.} =
let periodicity = await market.periodicity()
clock.advance(periodicity.seconds.truncate(int64))
let current = periodicity.periodOf(clock.now().u256)
let periodEnd = periodicity.periodEnd(current)
clock.set(periodEnd.truncate(int64) + 1)
test "switches to cancelled state when request expires":
let next = state.onCancelled(request)