mirror of
https://github.com/wassname/ray.git
synced 2026-07-19 11:27:32 +08:00
[Core]Fix ray.kill doesn't cancel pending actor bug (#13254)
This commit is contained in:
@@ -902,8 +902,10 @@ def test_capture_child_actors(ray_start_cluster):
|
||||
|
||||
# Kill an actor and wait until it is killed.
|
||||
ray.kill(a)
|
||||
with pytest.raises(ray.exceptions.RayActorError):
|
||||
try:
|
||||
ray.get(a.ready.remote())
|
||||
except ray.exceptions.RayActorError:
|
||||
pass
|
||||
|
||||
# Now create an actor, but do not capture the current tasks
|
||||
a = Actor.options(
|
||||
@@ -925,8 +927,10 @@ def test_capture_child_actors(ray_start_cluster):
|
||||
|
||||
# Kill an actor and wait until it is killed.
|
||||
ray.kill(a)
|
||||
with pytest.raises(ray.exceptions.RayActorError):
|
||||
try:
|
||||
ray.get(a.ready.remote())
|
||||
except ray.exceptions.RayActorError:
|
||||
pass
|
||||
|
||||
# Lastly, make sure when None is specified, actors are not scheduled
|
||||
# on the same placement group.
|
||||
@@ -1416,8 +1420,10 @@ ray.shutdown()
|
||||
|
||||
# Kill an actor and wait until it is killed.
|
||||
ray.kill(a)
|
||||
with pytest.raises(ray.exceptions.RayActorError):
|
||||
try:
|
||||
ray.get(a.ready.remote())
|
||||
except ray.exceptions.RayActorError:
|
||||
pass
|
||||
|
||||
# We should have 2 alive pgs and 4 alive actors.
|
||||
assert assert_alive_num_pg(2)
|
||||
|
||||
Reference in New Issue
Block a user