From bbb32362ca90236e28fdd71c1b6f9a3ade4f68b8 Mon Sep 17 00:00:00 2001 From: Ivan FB <128452529+Ivansete-status@users.noreply.github.com> Date: Tue, 30 Apr 2024 12:52:11 +0200 Subject: [PATCH] waku_node: first of all stop the waku-switch when stopping the waku-node (#2651) This is aimed to avoid having flaky tests --- waku/node/waku_node.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/waku/node/waku_node.nim b/waku/node/waku_node.nim index c329f9e28..0a7abb4b0 100644 --- a/waku/node/waku_node.nim +++ b/waku/node/waku_node.nim @@ -1217,6 +1217,9 @@ proc start*(node: WakuNode) {.async.} = info "Node started successfully" proc stop*(node: WakuNode) {.async.} = + ## By stopping the switch we are stopping all the underlying mounted protocols + await node.switch.stop() + node.peerManager.stop() if not node.wakuRlnRelay.isNil(): @@ -1228,9 +1231,6 @@ proc stop*(node: WakuNode) {.async.} = if not node.wakuArchive.isNil(): await node.wakuArchive.stopWait() - ## By stopping the switch we are stopping all the underlying mounted protocols - await node.switch.stop() - node.started = false proc isReady*(node: WakuNode): Future[bool] {.async: (raises: [Exception]).} =