-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
test: refactor test_observability_helpers
#53875
Conversation
5e62e4f
to
df818f2
Compare
Ready for review @abrarsheikh @zcin ! |
df818f2
to
5621c5c
Compare
5621c5c
to
abd626e
Compare
There was a problem hiding this 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]],
…be more extensive and less flaky Signed-off-by: Arthur <atte.book@gmail.com>
Signed-off-by: Arthur <atte.book@gmail.com>
abd626e
to
d987341
Compare
Signed-off-by: Arthur <atte.book@gmail.com>
There was a problem hiding this 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
test_backpressure
wait_for_conditiontest_observability_helpers
@@ -110,7 +111,7 @@ def wait_for_condition( | |||
|
|||
|
|||
async def async_wait_for_condition( | |||
condition_predictor: Callable[..., bool], | |||
condition_predictor: Callable[..., Awaitable[bool]], |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
## Why are these changes needed? Fix `test_batching` for windows. --------- Signed-off-by: Arthur <atte.book@gmail.com>
Why are these changes needed?
Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.