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
commit 8ed6de4fe6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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()