From acdaeb8f5de17f394baf0f24889048e319dcf5fb Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Thu, 13 Feb 2020 10:19:26 -0500 Subject: [PATCH] working out synchronization issues --- libp2p/muxers/mplex/lpchannel.nim | 3 +-- tests/pubsub/testfloodsub.nim | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/libp2p/muxers/mplex/lpchannel.nim b/libp2p/muxers/mplex/lpchannel.nim index bda141abf..dfd83a614 100644 --- a/libp2p/muxers/mplex/lpchannel.nim +++ b/libp2p/muxers/mplex/lpchannel.nim @@ -62,8 +62,7 @@ proc newChannel*(id: uint, result.initBufferStream(writeHandler, size) proc closeMessage(s: LPChannel) {.async.} = - if not s.closed: - await s.conn.writeMsg(s.id, s.closeCode) # write header + await s.conn.writeMsg(s.id, s.closeCode) # write header proc closedByRemote*(s: LPChannel) {.async.} = s.closedRemote = true diff --git a/tests/pubsub/testfloodsub.nim b/tests/pubsub/testfloodsub.nim index d60b30b29..f8389d7af 100644 --- a/tests/pubsub/testfloodsub.nim +++ b/tests/pubsub/testfloodsub.nim @@ -223,7 +223,7 @@ suite "FloodSub": await node.publish("foobar", cast[seq[byte]]("Hello!")) await sleepAsync(100.millis) - await sleepAsync(1.minutes) + await sleepAsync(5000.millis) await allFutures(nodes.mapIt(it.stop())) await allFutures(awaitters)