From a1a1447f1cad31eb9efcb938e0e626b8d229f0d9 Mon Sep 17 00:00:00 2001 From: Tom Pantelis Date: Tue, 26 Jul 2016 01:22:31 -0400 Subject: [PATCH] Fix test failure in ShardTest SHardTest#createSnapshotTest failed on jenkins due to using the CallingThreadDispatcher, which is the default for test actors, instead of the default dispatcher. Change-Id: Id0d8186cb8bda356b81a056f4a0fd2bbecd3c7b4 Signed-off-by: Tom Pantelis --- .../controller/cluster/datastore/ShardTest.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java index a7e7e8fb98..87cfae8082 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java @@ -129,7 +129,7 @@ public class ShardTest extends AbstractShardTest { public void testRegisterChangeListener() throws Exception { new ShardTestKit(getSystem()) {{ final TestActorRef shard = actorFactory.createTestActor( - newShardProps(), "testRegisterChangeListener"); + newShardProps().withDispatcher(Dispatchers.DefaultDispatcherId()), "testRegisterChangeListener"); waitUntilLeader(shard); @@ -255,7 +255,7 @@ public class ShardTest extends AbstractShardTest { public void testRegisterDataTreeChangeListener() throws Exception { new ShardTestKit(getSystem()) {{ final TestActorRef shard = actorFactory.createTestActor( - newShardProps(), "testRegisterDataTreeChangeListener"); + newShardProps().withDispatcher(Dispatchers.DefaultDispatcherId()), "testRegisterDataTreeChangeListener"); waitUntilLeader(shard); @@ -437,7 +437,8 @@ public class ShardTest extends AbstractShardTest { @Test public void testApplyState() throws Exception { - final TestActorRef shard = actorFactory.createTestActor(newShardProps(), "testApplyState"); + final TestActorRef shard = actorFactory.createTestActor( + newShardProps().withDispatcher(Dispatchers.DefaultDispatcherId()), "testApplyState"); ShardTestKit.waitUntilLeader(shard); @@ -921,7 +922,8 @@ public class ShardTest extends AbstractShardTest { }; final TestActorRef shard = actorFactory.createTestActor( - Props.create(new DelegatingShardCreator(creator)), "testOnBatchedModificationsWhenNotLeader"); + Props.create(new DelegatingShardCreator(creator)). + withDispatcher(Dispatchers.DefaultDispatcherId()), "testOnBatchedModificationsWhenNotLeader"); waitUntilLeader(shard); @@ -2057,7 +2059,6 @@ public class ShardTest extends AbstractShardTest { testCreateSnapshot(false, "testCreateSnapshotWithNonPersistentData"); } - @SuppressWarnings("serial") private void testCreateSnapshot(final boolean persistent, final String shardActorName) throws Exception{ final AtomicReference latch = new AtomicReference<>(new CountDownLatch(1)); @@ -2104,7 +2105,8 @@ public class ShardTest extends AbstractShardTest { final Creator creator = () -> new TestShard(newShardBuilder()); final TestActorRef shard = actorFactory.createTestActor( - Props.create(new DelegatingShardCreator(creator)), shardActorName); + Props.create(new DelegatingShardCreator(creator)). + withDispatcher(Dispatchers.DefaultDispatcherId()), shardActorName); waitUntilLeader(shard); writeToStore(shard, TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME)); -- 2.36.6