Skip to content

Commit a179cb6

Browse files
committed
tests: Use a unique domain name for tests/multi_wlan/getaddrinfo.
Otherwise test can fail if the "should fail" lookup is resolved from a cached result. Signed-off-by: Angus Gratton <angus@redyak.com.au>
1 parent 8c6dfa5 commit a179cb6

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tests/multi_wlan/getaddrinfo.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ def instance0():
2020

2121
multitest.next()
2222

23+
# Note: Lookup domain for this test doesn't need to exist, as the board
24+
# isn't internet connected. It also shouldn't exist, so a cached result is
25+
# never returned!
2326
try:
24-
socket.getaddrinfo("micropython.org", 80)
27+
socket.getaddrinfo("doesnotexist.example.com", 80)
2528
except OSError as er:
2629
print(
2730
"active(0) failed"
@@ -30,7 +33,7 @@ def instance0():
3033
wlan.active(1)
3134

3235
try:
33-
socket.getaddrinfo("micropython.org", 80)
36+
socket.getaddrinfo("doesnotexist.example.com", 80)
3437
except OSError as er:
3538
print(
3639
"active(1) failed", er.errno in (-2, -202)

0 commit comments

Comments
 (0)