[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
@@ -59,6 +59,8 @@ public class KillActorTest extends BaseTest {
private void testKillActor(BiConsumer<ActorHandle<?>, Boolean> kill, boolean noRestart) {
ActorHandle<HangActor> actor = Ray.actor(HangActor::new).setMaxRestarts(1).remote();
// Wait for the actor to be created.
actor.task(HangActor::ping).remote().get();
ObjectRef<Boolean> result = actor.task(HangActor::hang).remote();
// The actor will hang in this task.
Assert.assertEquals(0, Ray.wait(ImmutableList.of(result), 1, 500).getReady().size());