Skip to content

Commit

Permalink
check for leaks properly
Browse files Browse the repository at this point in the history
  • Loading branch information
dryajov committed Aug 2, 2020
1 parent 01cdd11 commit fd2fa5d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/testswitch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,18 @@ suite "Switch":
var bufferTracker = getTracker(BufferStreamTrackerName)
# echo bufferTracker.dump()

# plus 4 for the pubsub streams
check (BufferStreamTracker(bufferTracker).opened ==
(BufferStreamTracker(bufferTracker).closed))
(BufferStreamTracker(bufferTracker).closed + 4.uint64))

var connTracker = getTracker(ConnectionTrackerName)
# echo connTracker.dump()

# plus 4 is for the secured connection and the socket
# plus 8 is for the secured connection and the socket
# and the pubsub streams that won't clean up until
# `disconnect()` or `stop()`
check (ConnectionTracker(connTracker).opened ==
(ConnectionTracker(connTracker).closed + 4.uint64))
(ConnectionTracker(connTracker).closed + 8.uint64))

await allFuturesThrowing(
done.wait(5.seconds),
Expand Down

0 comments on commit fd2fa5d

Please sign in to comment.