Skip to content

fix(client): stop the export poll loop from overrunning its timeout on Windows - #5568

Merged
nicoloboschi merged 3 commits into
mainfrom
fix-windows-export-poll-flake
Oct 14, 2026
Merged

nicoloboschi merged 3 commits into
mainfrom
fix-windows-export-poll-flake

Conversation

@nicoloboschi

@nicoloboschi nicoloboschi commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Windows Smoke Test has been red since f843f173b (#5515) on test_export_timeout_bounds_the_poll_sleep: assert 2 == 1.

The export poll loop slept min(poll_interval, remaining) and then raised at the top of the loop. Windows' ~16ms timer granularity lets asyncio.sleep return early, so after the final sleep there was still budget left and the loop did one more status poll — the exact thing the test exists to prevent.

Now the loop times out as soon as the remaining budget can't fit another full interval, so it never sleeps out a remainder it can't use. Deterministic on any clock, and one less pointless wait before the TimeoutError.

The same change is applied to the TypeScript wrapper's downloadOperationArchive, which had the identical shape — the two hand-written wrappers have to behave the same.

Verified: Windows Smoke Test dispatched on this branch passes (run 38534833329) — first green since the regression.

The poll loop slept the remaining budget and then timed out at the top of
the loop. On a coarse clock (Windows wakes a sleep up to ~16ms early) that
left enough budget for one extra status poll, which made the Windows smoke
run red. Time out as soon as the remainder can't fit another interval.
…wrapper

The two hand-written wrappers must expose the same behaviour; the TS poll
loop had the same 'sleep out a budget too small for another poll' shape.
@nicoloboschi
nicoloboschi merged commit 7a2df55 into main Oct 14, 2026
102 checks passed
@nicoloboschi
nicoloboschi deleted the fix-windows-export-poll-flake branch October 14, 2026 09:43
@nicoloboschi nicoloboschi mentioned this pull request Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant