Skip to content

Commit

Permalink
[sales] Fix intermittently failing test (#591)
Browse files Browse the repository at this point in the history
  • Loading branch information
markspanbroek authored Oct 19, 2023
1 parent c28627d commit a77d0cd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/codex/sales/testsales.nim
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,14 @@ asyncchecksuite "Sales":
let blk = bt.Block.new( @[1.byte] ).get
onBatch(@[ blk ])
return success()
let sold = newFuture[void]()
sales.onSale = proc(request: StorageRequest, slotIndex: UInt256) =
sold.complete()

createAvailability()
let origSize = availability.size
await market.requestStorage(request)
await sleepAsync(2.millis) # allow proving to start
await sold # allow proving to start

# complete request
market.slotState[request.slotId(slotIndex)] = SlotState.Finished
Expand Down

0 comments on commit a77d0cd

Please sign in to comment.