[core] Speed up test_actor_advanced.py#53738
Merged
edoakes merged 11 commits intoray-project:masterfrom Jun 12, 2025
Merged
Conversation
test_create_actor_race_conditiontest_actor_advanced.py
c77c8b9 to
b0def65
Compare
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
israbbani
reviewed
Jun 11, 2025
|
|
||
|
|
||
| def test_remote_functions_not_scheduled_on_actors(ray_start_regular): | ||
| # Make sure that regular remote functions are not scheduled on actors. |
Contributor
There was a problem hiding this comment.
Only the paranoid survive.
| def __init__(self): | ||
| pass | ||
| worker_node_ids = set() | ||
| for i in range(2): |
Contributor
There was a problem hiding this comment.
Should we test with an odd number of nodes and an odd number of actors too?
Collaborator
Author
There was a problem hiding this comment.
I don't see a strong reason for it
Comment on lines
-406
to
-421
| @pytest.mark.skip("Garbage collection for distributed actor handles not implemented.") | ||
| def test_garbage_collection(setup_queue_actor): | ||
| queue = setup_queue_actor | ||
|
|
||
| @ray.remote | ||
| def fork(queue): | ||
| for i in range(10): | ||
| x = queue.enqueue.remote(0, i) | ||
| time.sleep(0.1) | ||
| return ray.get(x) | ||
|
|
||
| x = fork.remote(queue) | ||
| ray.get(queue.read.remote()) | ||
| del queue | ||
|
|
||
| print(ray.get(x)) |
elliot-barn
pushed a commit
that referenced
this pull request
Jun 18, 2025
`test_create_actor_race_condition` previously took ~55s locally, now down to ~5s. - Removed outer loop running the test 50 times (excessive). - Added assertion that only one actor is actually created. Previously there could still be a race to create the actor. - Converted to use concurrent futures thread pool. `test_get_actor_race_condition` previously took ~10s locally, now down to ~4s. - Removed outer loop running the test 50 times (excessive). - Added assertion that only one actor is actually created. Previously there could still be a race to create the actor. Reduced the number of actors on a few other tests and deleted two skipped/useless ones. Test passed in 237s on this [premerge](https://buildkite.com/ray-project/premerge/builds/41870#0197600a-f4bf-414c-838d-eb5cb05c821d/185-1140). Test passed in 350s on latest [postmerge](https://buildkite.com/ray-project/postmerge/builds/10777#01975fbd-c04e-4cf5-8efe-2aa2d7c5c3b3/177-1163). --------- Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
elliot-barn
pushed a commit
that referenced
this pull request
Jul 2, 2025
`test_create_actor_race_condition` previously took ~55s locally, now down to ~5s. - Removed outer loop running the test 50 times (excessive). - Added assertion that only one actor is actually created. Previously there could still be a race to create the actor. - Converted to use concurrent futures thread pool. `test_get_actor_race_condition` previously took ~10s locally, now down to ~4s. - Removed outer loop running the test 50 times (excessive). - Added assertion that only one actor is actually created. Previously there could still be a race to create the actor. Reduced the number of actors on a few other tests and deleted two skipped/useless ones. Test passed in 237s on this [premerge](https://buildkite.com/ray-project/premerge/builds/41870#0197600a-f4bf-414c-838d-eb5cb05c821d/185-1140). Test passed in 350s on latest [postmerge](https://buildkite.com/ray-project/postmerge/builds/10777#01975fbd-c04e-4cf5-8efe-2aa2d7c5c3b3/177-1163). --------- Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test_create_actor_race_conditionpreviously took ~55s locally, now down to ~5s.test_get_actor_race_conditionpreviously took ~10s locally, now down to ~4s.Reduced the number of actors on a few other tests and deleted two skipped/useless ones.
Test passed in 237s on this premerge.
Test passed in 350s on latest postmerge.