8000 test: refactor `test_observability_helpers` by ArthurBook · Pull Request #53875 · ray-project/ray · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

test: refactor test_observability_helpers #53875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ArthurBook
Copy link
Contributor

Why are these changes needed?

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@ArthurBook ArthurBook force-pushed the arthurbook/refactor-batching-tests branch from 5e62e4f to df818f2 Compare June 17, 2025 18:00
@ArthurBook ArthurBook marked this pull request as ready for review June 17, 2025 18:00
@Copilot Copilot AI review requested due to automatic review settings June 17, 2025 18:00
@ArthurBook ArthurBook requested review from a team, edoakes and aslonnie as code owners June 17, 2025 18:00
@ArthurBook
Copy link
Contributor Author

Ready for review @abrarsheikh @zcin !

Copilot

This comment was marked as outdated.

@ArthurBook ArthurBook force-pushed the arthurbook/refactor-batching-tests branch from df818f2 to 5621c5c Compare June 17, 2025 18:24
@ArthurBook ArthurBook requested a review from Copilot June 17, 2025 18:24
Copilot

This comment was marked as outdated.

@ArthurBook ArthurBook force-pushed the arthurbook/refactor-batching-tests branch from 5621c5c to abd626e Compare June 17, 2025 18:38
@ArthurBook ArthurBook requested a review from Copilot June 17, 2025 18:39
Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the observability tests for batching by parameterizing the helper test and introducing new utility functions for sending requests and waiting for a desired number of waiters. Additionally, the type hint for the condition predictor in async_wait_for_condition has been updated.

  • Updated test_observability_helpers with parameterized inputs and a signal actor.
  • Added send_k_requests and wait_for_n_waiters helper functions.
  • Adjusted async_wait_for_condition’s condition_predictor type hint.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
python/ray/serve/tests/test_batching.py Updated and parameterized batching observability tests and utilities.
python/ray/_common/test_utils.py Modified the condition_predictor type hint in async_wait_for_condition.
Comments suppressed due to low confidence (2)

python/ray/serve/tests/test_batching.py:283

  • The parameter 'min_num_batches' is typed as float, but it is computed using math.ceil which returns an integer. Consider changing its type annotation to int for clarity.
async def send_k_requests(

python/ray/_common/test_utils.py:114

  • Changing the type hint to Callable[..., Awaitable[bool]] forces condition_predictor to be asynchronous. If synchronous functions should also be allowed, consider using a union type of bool and Awaitable[bool].
    condition_predictor: Callable[..., Awaitable[bool]],

@abrarsheikh abrarsheikh added the go add ONLY when ready to merge, run all tests label Jun 17, 2025
…be more extensive and less flaky

Signed-off-by: Arthur <atte.book@gmail.com>
Signed-off-by: Arthur <atte.book@gmail.com>
8000
@ArthurBook ArthurBook force-pushed the arthurbook/refactor-batching-tests branch 2 times, most recently from abd626e to d987341 Compare June 17, 2025 19:55
Signed-off-by: Arthur <atte.book@gmail.com>
Copy link
Contributor
@abrarsheikh abrarsheikh left a comment

Choose a reason for hiding this comment

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

lg2m, confirmed that test passes on windows. The postmerge is failing for a different issue that is known to be flaky

@ArthurBook ArthurBook changed the title WIP: try test_backpressure wait_for_condition test: refactor test_observability_helpers Jun 18, 2025
@@ -110,7 +111,7 @@ def wait_for_condition(


async def async_wait_for_condition(
condition_predictor: Callable[..., bool],
condition_predictor: Callable[..., Awaitable[bool]],
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this function only used in serve/tests/test_batching.py

Copy link
Collaborator

Choose a reason for hiding this comment

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

if yes, maybe move this function into that file?

@zcin zcin merged commit 09a00cd into ray-project:master Jun 23, 2025
5 of 6 checks passed
@ArthurBook ArthurBook deleted the arthurbook/refactor-batching-tests branch June 23, 2025 17:08
minerharry pushed a commit to minerharry/ray that referenced this pull request Jun 27, 2025
## Why are these changes needed?

Fix `test_batching` for windows.

---------

Signed-off-by: Arthur <atte.book@gmail.com>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0