Skip to content

Commit fdd5df0

Browse files
rustyconoverclaude
andcommitted
fix(test): poll for last stderr line in test_stderr_available_on_error
The poll loop broke as soon as the first stderr line ("Debug: worker starting") appeared, then asserted the second line ("Error: something went wrong") was also present. The drain thread reads stderr line-by-line, so on 3.14 Windows the loop could break after line 1 before line 2 was captured — a pre-existing race the condition papered over. Poll for the last-written line so both are guaranteed present. Verified 8/8 on Windows 3.14. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 071bfc2 commit fdd5df0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/table_in_out/test_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,10 @@ def test_stderr_available_on_error(self) -> None:
259259

260260
while elapsed < timeout:
261261
stderr_output = client.get_worker_stderr()
262-
# Check if we have the expected content
263-
if "Debug: worker starting" in stderr_output:
262+
# Poll for the LAST line written — the drain thread reads stderr
263+
# line-by-line, so seeing the first line doesn't guarantee the
264+
# second has been captured yet (a race that surfaced on Windows).
265+
if "Error: something went wrong" in stderr_output:
264266
break
265267
time.sleep(poll_interval)
266268
elapsed += poll_interval

0 commit comments

Comments
 (0)