mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-02-09 19:44:45 +00:00
fix flood tests
This commit is contained in:
parent
f98d2b635d
commit
31d79ebed8
@ -60,7 +60,7 @@ suite "FloodSub":
|
||||
await nodes[1].subscribe("foobar", handler)
|
||||
await waitSub(nodes[0], nodes[1], "foobar")
|
||||
|
||||
await nodes[0].publish("foobar", "Hello!".toBytes())
|
||||
discard await nodes[0].publish("foobar", "Hello!".toBytes())
|
||||
|
||||
result = await completionFut.wait(5.seconds)
|
||||
|
||||
@ -91,7 +91,7 @@ suite "FloodSub":
|
||||
await nodes[0].subscribe("foobar", handler)
|
||||
await waitSub(nodes[1], nodes[0], "foobar")
|
||||
|
||||
await nodes[1].publish("foobar", "Hello!".toBytes())
|
||||
discard await nodes[1].publish("foobar", "Hello!".toBytes())
|
||||
|
||||
result = await completionFut.wait(5.seconds)
|
||||
|
||||
@ -126,7 +126,7 @@ suite "FloodSub":
|
||||
|
||||
nodes[1].addValidator("foobar", validator)
|
||||
|
||||
await nodes[0].publish("foobar", "Hello!".toBytes())
|
||||
discard await nodes[0].publish("foobar", "Hello!".toBytes())
|
||||
|
||||
check (await handlerFut) == true
|
||||
await allFuturesThrowing(
|
||||
@ -160,7 +160,7 @@ suite "FloodSub":
|
||||
|
||||
nodes[1].addValidator("foobar", validator)
|
||||
|
||||
await nodes[0].publish("foobar", "Hello!".toBytes())
|
||||
discard await nodes[0].publish("foobar", "Hello!".toBytes())
|
||||
|
||||
await allFuturesThrowing(
|
||||
nodes[0].stop(),
|
||||
@ -198,8 +198,8 @@ suite "FloodSub":
|
||||
|
||||
nodes[1].addValidator("foo", "bar", validator)
|
||||
|
||||
await nodes[0].publish("foo", "Hello!".toBytes())
|
||||
await nodes[0].publish("bar", "Hello!".toBytes())
|
||||
discard await nodes[0].publish("foo", "Hello!".toBytes())
|
||||
discard await nodes[0].publish("bar", "Hello!".toBytes())
|
||||
|
||||
await allFuturesThrowing(
|
||||
nodes[0].stop(),
|
||||
@ -250,7 +250,7 @@ suite "FloodSub":
|
||||
subs &= waitSub(nodes[i], nodes[y], "foobar")
|
||||
await allFuturesThrowing(subs)
|
||||
|
||||
var pubs: seq[Future[void]]
|
||||
var pubs: seq[Future[int]]
|
||||
for i in 0..<runs:
|
||||
pubs &= nodes[i].publish("foobar", "Hello!".toBytes())
|
||||
await allFuturesThrowing(pubs)
|
||||
@ -304,7 +304,7 @@ suite "FloodSub":
|
||||
subs &= waitSub(nodes[i], nodes[y], "foobar")
|
||||
await allFuturesThrowing(subs)
|
||||
|
||||
var pubs: seq[Future[void]]
|
||||
var pubs: seq[Future[int]]
|
||||
for i in 0..<runs:
|
||||
pubs &= nodes[i].publish("foobar", "Hello!".toBytes())
|
||||
await allFuturesThrowing(pubs)
|
||||
|
Loading…
x
Reference in New Issue
Block a user