[Core]Fix ray.kill doesn't cancel pending actor bug (#13254)

This commit is contained in:
fangfengbin
2021-02-09 10:59:14 +08:00
committed by GitHub
parent 914696ac3f
commit 2092b097ea
19 changed files with 325 additions and 54 deletions
+9 -3
View File
@@ -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)