Skip to content

Conversation

@abrarsheikh
Copy link
Contributor

@abrarsheikh abrarsheikh commented May 31, 2025

Fixes: #53478

@abrarsheikh abrarsheikh added the go add ONLY when ready to merge, run all tests label May 31, 2025
Signed-off-by: abrar <[email protected]>
Copy link
Collaborator

@edoakes edoakes left a 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
Copy link
Collaborator

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 :)

@edoakes edoakes changed the title move signal and semaphore to _commons move signal and semaphore to _common/ Jun 2, 2025
Copy link
Collaborator

@aslonnie aslonnie left a 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]>
Copy link
Collaborator

@edoakes edoakes left a 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.

@edoakes edoakes merged commit 9f1dbff into master Jun 2, 2025
5 checks passed
@edoakes edoakes deleted the ray_private_signalactor branch June 2, 2025 19:50
@edoakes
Copy link
Collaborator

edoakes commented Jun 2, 2025

turns out doing that is a bit annoying:

  1. go to https://buildkite.com/ray-project/postmerge
  2. click "new build" (green button on top right)
  3. input branch name
  4. expand options
  5. and then add RAYCI_RUN_ALL_TESTS=1
  6. and then click "Create build"

so let's see if anything breaks and revert if needed :)

edoakes pushed a commit that referenced this pull request Jun 5, 2025
…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]>
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.

[core|serve] Migrate shared utilities from ray._private to ray._common

4 participants