Skip to content

Commit

Permalink
fix nim-lang#12919 tasyncclosestall flaky: Address already in use
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Dec 19, 2019
1 parent 206a4ce commit 0e9ce25
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/async/tasyncclosestall.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ else:
# This reproduces a case where a socket remains stuck waiting for writes
# even when the socket is closed.
const
port = Port(50726)
timeout = 8000
var port = Port(0)

var sent = 0

Expand Down Expand Up @@ -86,6 +86,8 @@ proc server() {.async.} =
s.setSockOpt(OptReuseAddr, true)
s.bindAddr(port)
s.listen()
let (addr2, port2) = s.getLocalAddr
port = port2

# We're now ready to accept connections, so start the client
asyncCheck startClient()
Expand Down

0 comments on commit 0e9ce25

Please sign in to comment.