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

This commit is contained in:
fangfengbin
2021-02-10 15:30:21 +08:00
committed by GitHub
parent ce80ef5aee
commit 1754359281
20 changed files with 330 additions and 56 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());