Brian O'Connor
Committed by Ray Milkey

Adding assertAfter to intermittent DistributedMastershipStoreTest

Change-Id: I0c6c9f20d21d3c5a3bfca518fada3b3b3b0b38a0
...@@ -26,6 +26,7 @@ import org.junit.Before; ...@@ -26,6 +26,7 @@ import org.junit.Before;
26 import org.junit.BeforeClass; 26 import org.junit.BeforeClass;
27 import org.junit.Ignore; 27 import org.junit.Ignore;
28 import org.junit.Test; 28 import org.junit.Test;
29 +import org.onlab.junit.TestTools;
29 import org.onlab.packet.IpAddress; 30 import org.onlab.packet.IpAddress;
30 import org.onosproject.cluster.ClusterServiceAdapter; 31 import org.onosproject.cluster.ClusterServiceAdapter;
31 import org.onosproject.cluster.ControllerNode; 32 import org.onosproject.cluster.ControllerNode;
...@@ -119,7 +120,8 @@ public class DistributedMastershipStoreTest { ...@@ -119,7 +120,8 @@ public class DistributedMastershipStoreTest {
119 assertTrue("wrong store state:", dms.roleMap.isEmpty()); 120 assertTrue("wrong store state:", dms.roleMap.isEmpty());
120 121
121 testStore.put(DID1, N1, true, false, false); 122 testStore.put(DID1, N1, true, false, false);
122 - assertEquals("wrong master:", N1, dms.getMaster(DID1)); 123 + TestTools.assertAfter(100, () -> //wait for up to 100ms
124 + assertEquals("wrong master:", N1, dms.getMaster(DID1)));
123 assertNull("wrong master:", dms.getMaster(DID2)); 125 assertNull("wrong master:", dms.getMaster(DID2));
124 } 126 }
125 127
......