Skip to content

Commit

Permalink
test_client: add nil error handling after serverSwitch.start() client…
Browse files Browse the repository at this point in the history
…Switch.start() (#2703)
  • Loading branch information
Ivansete-status authored May 15, 2024
1 parent 9dfdfa2 commit 5b1fbb2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/waku_store/test_client.nim
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ suite "Store Client":

await allFutures(serverSwitch.start(), clientSwitch.start())

if serverSwitch.peerInfo.isNil():
error "serverSwitch.peerInfo is nil"
raise newException(CatchableError, "serverSwitch.peerInfo is nil")

if clientSwitch.peerInfo.isNil():
error "clientSwitch.peerInfo is nil"
raise newException(CatchableError, "clientSwitch.peerInfo is nil")

serverPeerInfo = serverSwitch.peerInfo.toRemotePeerInfo()
clientPeerInfo = clientSwitch.peerInfo.toRemotePeerInfo()

Expand Down
8 changes: 8 additions & 0 deletions tests/waku_store_legacy/test_client.nim
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ suite "Store Client":

await allFutures(serverSwitch.start(), clientSwitch.start())

if serverSwitch.peerInfo.isNil():
error "serverSwitch.peerInfo is nil"
raise newException(CatchableError, "serverSwitch.peerInfo is nil")

if clientSwitch.peerInfo.isNil():
error "clientSwitch.peerInfo is nil"
raise newException(CatchableError, "clientSwitch.peerInfo is nil")

serverPeerInfo = serverSwitch.peerInfo.toRemotePeerInfo()
clientPeerInfo = clientSwitch.peerInfo.toRemotePeerInfo()

Expand Down

0 comments on commit 5b1fbb2

Please sign in to comment.