From a4d52d3a0781ad65b543f01b0e06ad30aa1c3a95 Mon Sep 17 00:00:00 2001 From: Tom Pantelis Date: Wed, 6 Jan 2016 09:21:23 -0500 Subject: [PATCH] Fix intermittent failure in DistributedEntityOwnershipIntegrationTest testCloseCandidateRegistrationInQuickSuccession fails sometimes with an "Unfinished stubbing" error from Mockito. Moved the stubbing calls above the close calls to fix it. Change-Id: I1a6bd789c7745d3a7b80cf166eda51f819ce2df1 Signed-off-by: Tom Pantelis --- .../DistributedEntityOwnershipIntegrationTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/DistributedEntityOwnershipIntegrationTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/DistributedEntityOwnershipIntegrationTest.java index e1a5759a41..25a6dc439a 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/DistributedEntityOwnershipIntegrationTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/DistributedEntityOwnershipIntegrationTest.java @@ -303,10 +303,6 @@ public class DistributedEntityOwnershipIntegrationTest { Mockito.reset(leaderMockListener); - candidate1.close(); - candidate2.close(); - candidate3.close(); - ArgumentCaptor leaderChangeCaptor = ArgumentCaptor.forClass(EntityOwnershipChange.class); ArgumentCaptor follower1ChangeCaptor = ArgumentCaptor.forClass(EntityOwnershipChange.class); ArgumentCaptor follower2ChangeCaptor = ArgumentCaptor.forClass(EntityOwnershipChange.class); @@ -314,6 +310,10 @@ public class DistributedEntityOwnershipIntegrationTest { doNothing().when(follower1MockListener).ownershipChanged(follower1ChangeCaptor.capture()); doNothing().when(follower2MockListener).ownershipChanged(follower2ChangeCaptor.capture()); + candidate1.close(); + candidate2.close(); + candidate3.close(); + boolean passed = false; for(int i=0;i<100;i++) { Uninterruptibles.sleepUninterruptibly(50, TimeUnit.MILLISECONDS); -- 2.36.6