Skip to content

Commit 09dd23d

Browse files
committed
server tests: fix connect on dual-stack systems
1 parent 4479b85 commit 09dd23d

File tree

1 file changed

+5
-2
lines changed
  • examples/server/tests/features/steps

1 file changed

+5
-2
lines changed

examples/server/tests/features/steps/steps.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,12 @@ def step_start_server(context):
137137
if 'GITHUB_ACTIONS' in os.environ:
138138
max_attempts *= 2
139139

140+
addrs = socket.getaddrinfo(context.server_fqdn, context.server_port, type=socket.SOCK_STREAM)
141+
family, typ, proto, _, sockaddr = addrs[0]
142+
140143
while True:
141-
with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as sock:
142-
result = sock.connect_ex((context.server_fqdn, context.server_port))
144+
with closing(socket.socket(family, typ, proto)) as sock:
145+
result = sock.connect_ex(sockaddr)
143146
if result == 0:
144147
print("\x1b[33;46mserver started!\x1b[0m")
145148
return

0 commit comments

Comments
 (0)