Adding assertAfter to intermittent DistributedMastershipStoreTest
Change-Id: I0c6c9f20d21d3c5a3bfca518fada3b3b3b0b38a0
diff --git a/core/store/dist/src/test/java/org/onosproject/store/mastership/impl/DistributedMastershipStoreTest.java b/core/store/dist/src/test/java/org/onosproject/store/mastership/impl/DistributedMastershipStoreTest.java
index d3247ec..31386df 100644
--- a/core/store/dist/src/test/java/org/onosproject/store/mastership/impl/DistributedMastershipStoreTest.java
+++ b/core/store/dist/src/test/java/org/onosproject/store/mastership/impl/DistributedMastershipStoreTest.java
@@ -26,6 +26,7 @@
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
+import org.onlab.junit.TestTools;
import org.onlab.packet.IpAddress;
import org.onosproject.cluster.ClusterServiceAdapter;
import org.onosproject.cluster.ControllerNode;
@@ -119,7 +120,8 @@
assertTrue("wrong store state:", dms.roleMap.isEmpty());
testStore.put(DID1, N1, true, false, false);
- assertEquals("wrong master:", N1, dms.getMaster(DID1));
+ TestTools.assertAfter(100, () -> //wait for up to 100ms
+ assertEquals("wrong master:", N1, dms.getMaster(DID1)));
assertNull("wrong master:", dms.getMaster(DID2));
}