Skip to content

[serve] Deflake test_batch_size_multiple_zero_timeout on Windows - #67910

Merged
abrarsheikh merged 1 commit into
ray-project:masterfrom
johntaylor-cell:serve-batching-zero-timeout-deflake
Nov 6, 2026
Merged

abrarsheikh merged 1 commit into
ray-project:masterfrom
johntaylor-cell:serve-batching-zero-timeout-deflake

Conversation

@johntaylor-cell

Copy link
Copy Markdown
Contributor

The test used a 1 ms wait_for as a proxy for "t1's batch has formed". On Windows the asyncio clock ticks every 15.6 ms, so that timer fires on the next loop iteration. Since #67877 frees the batch permit in a done callback, the loop is a few iterations behind and t2 joins t1's batch. Wait for t1's batch to start instead.

@johntaylor-cell
johntaylor-cell requested a review from a team as a code owner November 6, 2026 15:49
@johntaylor-cell johntaylor-cell self-assigned this Nov 6, 2026
@johntaylor-cell johntaylor-cell added serve Ray Serve Related Issue go add ONLY when ready to merge, run all tests labels Nov 6, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves the reliability of the unit test 'test_batch_size_multiple_zero_timeout' in 'python/ray/serve/tests/unit/test_batching.py'. It replaces a flaky, short timeout with an explicit 'asyncio.Event' ('batch_started_event') to ensure the first batch has started before subsequent tasks are queued, preventing race conditions particularly on Windows. There are no review comments, so I have no feedback to provide.

The test used a 1 ms wait_for as a proxy for "t1's batch has formed". On
Windows the asyncio clock ticks every 15.6 ms, so that timer fires on the
next loop iteration. Since ray-project#67877 frees the batch permit in a done
callback, the loop is a few iterations behind and t2 joins t1's batch.
Wait for t1's batch to start instead.

Signed-off-by: john.taylor <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@abrarsheikh
abrarsheikh enabled auto-merge (squash) November 6, 2026 15:53
@johntaylor-cell
johntaylor-cell force-pushed the serve-batching-zero-timeout-deflake branch from 1ce609b to fed9db9 Compare November 6, 2026 15:54
@github-actions
github-actions Bot disabled auto-merge November 6, 2026 15:54
@abrarsheikh
abrarsheikh merged commit 58a6977 into ray-project:master Nov 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests serve Ray Serve Related Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants