fix flood tests

This commit is contained in:
Giovanni Petrantoni 2020-06-28 11:58:12 +09:00
parent f98d2b635d
commit 31d79ebed8

View File

@ -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)