use all() for futures and track connections

This commit is contained in:
Dmitriy Ryajov 2020-05-23 11:14:22 -06:00
parent 86e1c8169c
commit 4c191866e4
1 changed files with 4 additions and 0 deletions

View File

@ -83,6 +83,7 @@ proc testPubSubDaemonPublish(gossip: bool = false,
let smsg = cast[string](data) let smsg = cast[string](data)
check smsg == pubsubData check smsg == pubsubData
times.inc() times.inc()
echo "TIMES ", times
if times >= count and not finished: if times >= count and not finished:
finished = true finished = true
@ -107,6 +108,7 @@ proc testPubSubDaemonPublish(gossip: bool = false,
await wait(publisher(), 5.minutes) # should be plenty of time await wait(publisher(), 5.minutes) # should be plenty of time
echo "HEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"
result = true result = true
await nativeNode.stop() await nativeNode.stop()
await allFutures(awaiters) await allFutures(awaiters)
@ -142,6 +144,7 @@ proc testPubSubNodePublish(gossip: bool = false,
let smsg = cast[string](message.data) let smsg = cast[string](message.data)
check smsg == pubsubData check smsg == pubsubData
times.inc() times.inc()
echo "TIMES ", times
if times >= count and not finished: if times >= count and not finished:
finished = true finished = true
result = true # don't cancel subscription result = true # don't cancel subscription
@ -353,6 +356,7 @@ suite "Interop":
check line == test check line == test
await conn.writeLp(cast[seq[byte]](test)) await conn.writeLp(cast[seq[byte]](test))
count.inc() count.inc()
echo "COUNT ", count
testFuture.complete(count) testFuture.complete(count)
await conn.close() await conn.close()