fix flaky tnetconnect which sometimes failed with: No route to host [OSError] (#17526)

This commit is contained in:
Timothee Cour
2021-03-27 02:22:42 -07:00
committed by GitHub
parent b1b767ed0d
commit 8ed6de4fe6

View File

@@ -17,10 +17,11 @@ proc test() =
wrapSocket(ctx, socket)
# trying 2 sites makes it more resilent: refs #17458 this could give:
# Error: unhandled exception: Call to 'connect' timed out. [TimeoutError]
# * Call to 'connect' timed out. [TimeoutError]
# * No route to host [OSError]
try:
fn("www.nim-lang.org")
except TimeoutError:
except TimeoutError, OSError:
fn("www.google.com")
test()