Skip to content

Commit

Permalink
[Core] Fix test_no_worker_child_process_leaks (ray-project#35840)
Browse files Browse the repository at this point in the history
Thanks @iycheng for debugging this!

In ray-project#33976 we don't always guarantee that children of worker processes are killed -- namely if the worker dies in an unexpected way, they are not (see ray-project#26118).

This unfortunately happens in the `test_no_worker_child_process_leaks` test case since the Ray cluster is torn down when the driver exits, which can lead to worker processes being forcefully terminated [the solution in this PR is to not initialize the Ray cluster in the driver script but start a separate head node with `.add_node`].

As a result of this forceful killing, the test becomes flaky (it passes if the workers are killed through the normal termination, and it doesn't pass if the workers are killed otherwise). The flakiness is not super big right now but becomes big with some other changes.

This should eventually be fixed with ray-project#26118.
  • Loading branch information
pcmoritz committed May 27, 2023
1 parent 35cdd25 commit 6e032bb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions python/ray/tests/test_failure_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ def test_no_worker_child_process_leaks(ray_start_cluster, tmp_path):
"""

output_file_path = tmp_path / "leaked_pids.json"
ray_start_cluster.add_node()
driver_script = f"""
import ray
import json
Expand Down

0 comments on commit 6e032bb

Please sign in to comment.