-
Notifications
You must be signed in to change notification settings - Fork 7.1k
move signal and semaphore to _common/
#53457
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
Conversation
Signed-off-by: abrar <[email protected]>
Signed-off-by: abrar <[email protected]>
Signed-off-by: abrar <[email protected]>
edoakes
left a comment
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.
Thanks, especially for also adding the tests! Mostly just a comment on the naming
| import sys | ||
| import ray | ||
| from ray._common.synchronization_actors import SignalActor, Semaphore | ||
| from ray._private.test_utils import wait_for_condition |
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.
wait_for_condition is probably up next :)
_common/
aslonnie
left a comment
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.
(leaving this PR for @edoakes to review)
Signed-off-by: abrar <[email protected]>
edoakes
left a comment
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.
LGTM. We should probably run the full set of postmerge tests on this before merging to be sure nothing is missed. Asking Lonnie how to do that.
|
turns out doing that is a bit annoying:
so let's see if anything breaks and revert if needed :) |
…s` directory (#53543) ## Why are these changes needed? In #53457 we moved signal and semaphore to `_common/` which is used in `serve` tests. However, after that, `_common` had two `test_utils` which was confusing. This PR reorganizes the test utilities and their tests for better clarity: **Key Changes:** - Keep `SignalActor` and `Semaphore` test utility classes in `_common/test_utils.py` to ensure they're included in Ray package distribution (external libraries need access to these) - Separate tests for utility functions into `_common/tests/test_utils.py` (tests for `ray._common.utils` functions) - Rename and move tests for test utility classes to `_common/tests/test_signal_semaphore_utils.py` (tests for `SignalActor` and `Semaphore`) - Add comprehensive documentation and comments explaining the organization **Final Organization:** - `_common/test_utils.py`: Test utility classes (`SignalActor`, `Semaphore`) - distributed with Ray package - `_common/tests/test_utils.py`: Tests for Ray utility functions (`get_or_create_event_loop`, `run_background_task`) - `_common/tests/test_signal_semaphore_utils.py`: Tests for test utility classes This resolves the confusion of having multiple `test_utils` files while ensuring test utilities remain accessible to external libraries that depend on Ray. The separation maintains clear boundaries between utility classes (for distribution) and their tests (for development). --------- Signed-off-by: Sagar Sumit <[email protected]>
Fixes: #53478