mirror of
https://github.com/codex-storage/nim-codex.git
synced 2025-02-17 07:16:47 +00:00
[wip] reproduce issue #494
https://github.com/codex-storage/nim-codex/issues/494
This commit is contained in:
parent
098baf47d1
commit
d34d31a6e8
@ -263,17 +263,18 @@ asyncchecksuite "Sales":
|
|||||||
# check that request was ignored due to no matching availability
|
# check that request was ignored due to no matching availability
|
||||||
check always itemsProcessed.len == 0
|
check always itemsProcessed.len == 0
|
||||||
|
|
||||||
test "adds past requests to queue once availability added":
|
for _ in 0..<10000:
|
||||||
var itemsProcessed: seq[SlotQueueItem] = @[]
|
test "adds past requests to queue once availability added":
|
||||||
queue.onProcessSlot = proc(item: SlotQueueItem, done: Future[void]) {.async.} =
|
var itemsProcessed: seq[SlotQueueItem] = @[]
|
||||||
itemsProcessed.add item
|
queue.onProcessSlot = proc(item: SlotQueueItem, done: Future[void]) {.async.} =
|
||||||
done.complete()
|
itemsProcessed.add item
|
||||||
|
done.complete()
|
||||||
|
|
||||||
await market.requestStorage(request)
|
await market.requestStorage(request)
|
||||||
|
|
||||||
# now add matching availability
|
# now add matching availability
|
||||||
check isOk await reservations.reserve(availability)
|
check isOk await reservations.reserve(availability)
|
||||||
check eventuallyCheck itemsProcessed.len == request.ask.slots.int
|
check eventuallyCheck itemsProcessed.len == request.ask.slots.int
|
||||||
|
|
||||||
test "makes storage unavailable when downloading a matched request":
|
test "makes storage unavailable when downloading a matched request":
|
||||||
var used = false
|
var used = false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user