Fix intermittent testFlipMemberVotingStates failure 99/74299/1
authorTom Pantelis <tompantelis@gmail.com>
Sat, 21 Jul 2018 03:26:47 +0000 (23:26 -0400)
committerTom Pantelis <tompantelis@gmail.com>
Sat, 21 Jul 2018 03:26:47 +0000 (23:26 -0400)
Failure was see in auto-release:

ClusterAdminRpcServiceTest.testFlipMemberVotingStates:976->lambda$testFlipMemberVotingStates$8:978 Expected leader member-1. Actual: member-1-shard-cars-oper_testFlipMemberVotingStates

The test output showed it timed out trying to transfer leadership to member-3. The
timeout deadline is the election timeout interval which is the
heartbeatInterval * election-timeout-factor which were set to 300 and 1.
It seems 300ms is a bit too low for comfort so I changed it to 1000ms (100 * 10);

Change-Id: I1e3c79de960dcced8af71fecdf1ab8bdba433448
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
opendaylight/md-sal/sal-cluster-admin-impl/src/test/java/org/opendaylight/controller/cluster/datastore/admin/ClusterAdminRpcServiceTest.java

index 6aebe06..8f9f2b2 100644 (file)
@@ -933,8 +933,8 @@ public class ClusterAdminRpcServiceTest {
 
         String moduleShardsConfig = "module-shards-member1-and-2-and-3.conf";
         final MemberNode leaderNode1 = MemberNode.builder(memberNodes).akkaConfig("Member1").testName(name)
-                .moduleShardsConfig(moduleShardsConfig).datastoreContextBuilder(
-                        DatastoreContext.newBuilder().shardHeartbeatIntervalInMillis(300).shardElectionTimeoutFactor(1))
+                .moduleShardsConfig(moduleShardsConfig).datastoreContextBuilder(DatastoreContext.newBuilder()
+                        .shardHeartbeatIntervalInMillis(100).shardElectionTimeoutFactor(10))
                 .build();
 
         final MemberNode replicaNode2 = MemberNode.builder(memberNodes).akkaConfig("Member2").testName(name)
@@ -971,13 +971,13 @@ public class ClusterAdminRpcServiceTest {
         // Leadership should have transferred to member 3 since it is the only remaining voting member.
         verifyRaftState(leaderNode1.configDataStore(), "cars", raftState -> {
             assertNotNull("Expected non-null leader Id", raftState.getLeader());
-            assertTrue("Expected leader member-1. Actual: " + raftState.getLeader(),
+            assertTrue("Expected leader member-3. Actual: " + raftState.getLeader(),
                     raftState.getLeader().contains("member-3"));
         });
 
         verifyRaftState(leaderNode1.operDataStore(), "cars", raftState -> {
             assertNotNull("Expected non-null leader Id", raftState.getLeader());
-            assertTrue("Expected leader member-1. Actual: " + raftState.getLeader(),
+            assertTrue("Expected leader member-3. Actual: " + raftState.getLeader(),
                     raftState.getLeader().contains("member-3"));
         });
 

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.