Fixes Java test on null empty state: try to avoid race condition by waiting for 1 persistent actor to stop before starting the next one (#30579)

This commit is contained in:
Debasish Ghosh 2021-08-26 21:59:16 +05:30 committed by GitHub
parent 6bada7a107
commit cd2b9bcd11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -90,6 +90,8 @@ public class NullEmptyStateTest extends JUnitSuite {
ActorRef<String> ref1 = testKit.spawn(b);
probe.expectMessage("onRecoveryCompleted:null");
ref1.tell("stop");
// wait till ref1 stops
probe.expectTerminated(ref1);
ActorRef<String> ref2 = testKit.spawn(b);
probe.expectMessage("onRecoveryCompleted:null");
@ -99,6 +101,8 @@ public class NullEmptyStateTest extends JUnitSuite {
probe.expectMessage("eventHandler:one:two");
ref2.tell("stop");
// wait till ref2 stops
probe.expectTerminated(ref2);
ActorRef<String> ref3 = testKit.spawn(b);
// eventHandler from reply
probe.expectMessage("eventHandler:null:one");