Fix intermittent PreLeaderScenarioTest failure
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / ShardTest.java
index 54183ae0ff1b54160bfe4ceba639d6817b81b4d8..5869271fb811fc5209f5199f9f276a06ca0c24a9 100644 (file)
@@ -2076,8 +2076,7 @@ public class ShardTest extends AbstractShardTest {
 
                 waitUntilLeader(shard);
 
-                final TestActorRef<MessageCollectorActor> listener =
-                        TestActorRef.create(getSystem(), Props.create(MessageCollectorActor.class));
+                final ActorRef listener = getSystem().actorOf(MessageCollectorActor.props());
 
                 shard.tell(new RegisterRoleChangeListener(), listener);
 
@@ -2324,7 +2323,8 @@ public class ShardTest extends AbstractShardTest {
 
     @Test
     public void testServerRemoved() throws Exception {
-        final TestActorRef<MessageCollectorActor> parent = actorFactory.createTestActor(MessageCollectorActor.props());
+        final TestActorRef<MessageCollectorActor> parent = actorFactory.createTestActor(MessageCollectorActor.props()
+                .withDispatcher(Dispatchers.DefaultDispatcherId()));
 
         final ActorRef shard = parent.underlyingActor().context().actorOf(
                 newShardBuilder().props().withDispatcher(Dispatchers.DefaultDispatcherId()),