From daef00fc7ba8f361f4ce49609726c7c184733c14 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Sat, 23 May 2020 11:15:47 -0600 Subject: [PATCH] don't crash schlesi-dev --- libp2p/protocols/pubsub/pubsubpeer.nim | 2 +- tests/testinterop.nim | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libp2p/protocols/pubsub/pubsubpeer.nim b/libp2p/protocols/pubsub/pubsubpeer.nim index d2f6273..55794d8 100644 --- a/libp2p/protocols/pubsub/pubsubpeer.nim +++ b/libp2p/protocols/pubsub/pubsubpeer.nim @@ -79,7 +79,7 @@ proc handle*(p: PubSubPeer, conn: Connection) {.async.} = proc send*(p: PubSubPeer, msgs: seq[RPCMsg]) {.async.} = for m in msgs.items: - trace "sending msgs to peer", toPeer = p.id, msgs = msgs + trace "sending msgs to peer", toPeer = p.id, msgs = $msgs let encoded = encodeRpcMsg(m) # trigger hooks if not(isNil(p.observers)) and p.observers[].len > 0: diff --git a/tests/testinterop.nim b/tests/testinterop.nim index 634c6bf..ace1ad2 100644 --- a/tests/testinterop.nim +++ b/tests/testinterop.nim @@ -83,7 +83,6 @@ proc testPubSubDaemonPublish(gossip: bool = false, let smsg = cast[string](data) check smsg == pubsubData times.inc() - echo "TIMES ", times if times >= count and not finished: finished = true @@ -108,7 +107,6 @@ proc testPubSubDaemonPublish(gossip: bool = false, await wait(publisher(), 5.minutes) # should be plenty of time - echo "HEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" result = true await nativeNode.stop() await allFutures(awaiters) @@ -144,7 +142,6 @@ proc testPubSubNodePublish(gossip: bool = false, let smsg = cast[string](message.data) check smsg == pubsubData times.inc() - echo "TIMES ", times if times >= count and not finished: finished = true result = true # don't cancel subscription @@ -167,10 +164,14 @@ proc testPubSubNodePublish(gossip: bool = false, await daemonNode.close() suite "Interop": - teardown: - for tracker in testTrackers(): - echo tracker.dump() - # check tracker.isLeaked() == false + # TODO: chronos transports are leaking, + # but those are tracked for both the daemon + # and libp2p, so not sure which one it is, + # need to investigate more + # teardown: + # for tracker in testTrackers(): + # # echo tracker.dump() + # # check tracker.isLeaked() == false test "native -> daemon multiple reads and writes": proc runTests(): Future[bool] {.async.} = @@ -352,7 +353,6 @@ suite "Interop": check line == test await conn.writeLp(cast[seq[byte]](test)) count.inc() - echo "COUNT ", count testFuture.complete(count) await conn.close()