Revert "Fix DistributedEntityOwnershipIntegrationTest failure" 89/28089/1
authorThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 8 Oct 2015 15:26:37 +0000 (11:26 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 8 Oct 2015 15:37:53 +0000 (11:37 -0400)
This reverts commit de587f935016a300cdbeb85926c2eb677f383fc2.

Change-Id: I6d587db51aac176ad0ff0d5078e1c9b7cce802aa
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/DistributedEntityOwnershipIntegrationTest.java

index 1bb579848da8c66269bbc97fae44a4c506912c20..0ea7b7536cb05e8cde3875b55816ce5ee44c0784 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.controller.cluster.datastore.entityownership;
 
 import static org.junit.Assert.assertEquals;
 import static org.mockito.AdditionalMatchers.or;
-import static org.mockito.Mockito.atMost;
 import static org.mockito.Mockito.reset;
 import static org.mockito.Mockito.timeout;
 import static org.mockito.Mockito.verify;
@@ -199,17 +198,11 @@ public class DistributedEntityOwnershipIntegrationTest {
         // Unregister follower1 candidate for entity2 and verify follower2 becomes owner
 
         follower1EntityOwnershipService.unregisterCandidate(ENTITY2);
-        verifyCandidates(leaderDistributedDataStore, ENTITY2, "member-3");
         verifyOwner(leaderDistributedDataStore, ENTITY2, "member-3");
+        verify(follower2MockListener, timeout(5000)).ownershipChanged(ownershipChange(ENTITY2, false, true, true));
         verify(follower1MockListener, timeout(5000)).ownershipChanged(ownershipChange(ENTITY2, true, false, true));
         verify(leaderMockListener, timeout(5000)).ownershipChanged(ownershipChange(ENTITY2, false, false, true));
-
-        // Depending on timing, follower2MockListener could get ownershipChanged with "false, false, true" if
-        // if the original ownership change with "member-2 is replicated to follower2 after the listener is
-        // registered.
-        Uninterruptibles.sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
-        verify(follower2MockListener, atMost(1)).ownershipChanged(ownershipChange(ENTITY2, false, false, true));
-        verify(follower2MockListener, timeout(5000)).ownershipChanged(ownershipChange(ENTITY2, false, true, true));
+        verifyCandidates(leaderDistributedDataStore, ENTITY2, "member-3");
 
         // Register follower1 candidate for entity3 and verify it becomes owner