Skip to content

Commit e2af552

Browse files
rustyconoverclaude
andcommitted
test: wait up to 60 s for granian's first response in the idle-exit test
granian prints PORT before its workers listen; a cold macOS runner took over 10 s to start them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 5b9ea86 commit e2af552

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎tests/test_idle_exit.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ def _serve(port: int, idle: str, *extra: str) -> subprocess.Popen[str]:
266266
return proc
267267

268268

269-
def _get(port: int, path: str, method: str = "GET") -> int:
270-
deadline = time.monotonic() + 10
269+
def _get(port: int, path: str, method: str = "GET", wait: float = 10) -> int:
270+
deadline = time.monotonic() + wait
271271
while True:
272272
try:
273273
req = urllib.request.Request(f"http://127.0.0.1:{port}{path}", method=method)
@@ -309,7 +309,9 @@ def test_serve_exits_cleanly_when_idle(extra: tuple[str, ...]) -> None:
309309
port = _free_port()
310310
proc = _serve(port, "2", *extra)
311311
try:
312-
_get(port, "/")
312+
# granian announces its port before its workers listen, and a cold macOS
313+
# runner can take well over 10 s to start them.
314+
_get(port, "/", wait=60)
313315
# Busy for well over the period: still serving.
314316
end = time.monotonic() + 4
315317
while time.monotonic() < end:

0 commit comments

Comments
 (0)