From d34d31a6e8185218ef4029903bab50046d3096bc Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Tue, 29 Aug 2023 10:47:36 +0200 Subject: [PATCH] [wip] reproduce issue #494 https://github.com/codex-storage/nim-codex/issues/494 --- tests/codex/sales/testsales.nim | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/codex/sales/testsales.nim b/tests/codex/sales/testsales.nim index 79c4caf7..80264e56 100644 --- a/tests/codex/sales/testsales.nim +++ b/tests/codex/sales/testsales.nim @@ -263,17 +263,18 @@ asyncchecksuite "Sales": # check that request was ignored due to no matching availability check always itemsProcessed.len == 0 - test "adds past requests to queue once availability added": - var itemsProcessed: seq[SlotQueueItem] = @[] - queue.onProcessSlot = proc(item: SlotQueueItem, done: Future[void]) {.async.} = - itemsProcessed.add item - done.complete() + for _ in 0..<10000: + test "adds past requests to queue once availability added": + var itemsProcessed: seq[SlotQueueItem] = @[] + queue.onProcessSlot = proc(item: SlotQueueItem, done: Future[void]) {.async.} = + itemsProcessed.add item + done.complete() - await market.requestStorage(request) + await market.requestStorage(request) - # now add matching availability - check isOk await reservations.reserve(availability) - check eventuallyCheck itemsProcessed.len == request.ask.slots.int + # now add matching availability + check isOk await reservations.reserve(availability) + check eventuallyCheck itemsProcessed.len == request.ask.slots.int test "makes storage unavailable when downloading a matched request": var used = false