Adding sleep to handle Acl test failures, due to unceratin fails. 64/90064/1
authorNishchya Gupta <nishchyag@altencalsoftlabs.com>
Fri, 29 May 2020 08:51:48 +0000 (14:21 +0530)
committerNishchya Gupta <nishchyag@altencalsoftlabs.com>
Fri, 29 May 2020 08:51:48 +0000 (14:21 +0530)
ACL test fails randomly, due to incompletion of DS write,
Adding sleep to allowing them to complete.

Signed-off-by: Nishchya Gupta <nishchyag@altencalsoftlabs.com>
Change-Id: I5293e725cc2d20abdc93da4a163b1082a4b31ec5

aclservice/impl/src/test/java/org/opendaylight/netvirt/aclservice/tests/AclServiceTestBase.java

index 1bb5673955c27029885a09494bea21c9c998fefb..c7a34178e115c16023b6a249b81137e38f474bbb 100644 (file)
@@ -19,7 +19,6 @@ import java.util.stream.Collectors;
 import javax.inject.Inject;
 import org.eclipse.xtext.xbase.lib.Pair;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker;
@@ -148,7 +147,7 @@ public abstract class AclServiceTestBase {
         putNewStateInterface(dataBroker, "port1", PORT_MAC_1);
 
         asyncEventsWaiter.awaitEventsConsumption();
-
+        Thread.sleep(1000);
         // Then
         newInterfaceCheck();
         LOG.info("newInterface - end");
@@ -157,7 +156,6 @@ public abstract class AclServiceTestBase {
     abstract void newInterfaceCheck();
 
     @Test
-    @Ignore
     public void newInterfaceWithEtherTypeAcl() throws Exception {
         LOG.info("newInterfaceWithEtherTypeAcl - start");
 
@@ -190,7 +188,7 @@ public abstract class AclServiceTestBase {
         asyncEventsWaiter.awaitEventsConsumption();
 
         asyncEventsWaiter.awaitEventsConsumption();
-
+        Thread.sleep(1000);
         // Then
         newInterfaceWithEtherTypeAclCheck();
         LOG.info("newInterfaceWithEtherTypeAcl - end");
@@ -231,7 +229,7 @@ public abstract class AclServiceTestBase {
         asyncEventsWaiter.awaitEventsConsumption();
 
         asyncEventsWaiter.awaitEventsConsumption();
-
+        Thread.sleep(1000);
         // Then
         newInterfaceWithEtherTypeAclCheck();
 
@@ -264,6 +262,7 @@ public abstract class AclServiceTestBase {
         asyncEventsWaiter.awaitEventsConsumption();
 
         asyncEventsWaiter.awaitEventsConsumption();
+        Thread.sleep(1000);
         newInterfaceWithMultipleAclCheck();
     }
 
@@ -304,7 +303,7 @@ public abstract class AclServiceTestBase {
         asyncEventsWaiter.awaitEventsConsumption();
 
         asyncEventsWaiter.awaitEventsConsumption();
-
+        Thread.sleep(1000);
         // Then
         newInterfaceWithTcpDstAclCheck();
         LOG.info("newInterfaceWithTcpDstAcl - end");
@@ -348,7 +347,7 @@ public abstract class AclServiceTestBase {
         asyncEventsWaiter.awaitEventsConsumption();
 
         asyncEventsWaiter.awaitEventsConsumption();
-
+        Thread.sleep(1000);
         // Then
         newInterfaceWithUdpDstAclCheck();
         LOG.info("newInterfaceWithUdpDstAcl - end");
@@ -376,7 +375,7 @@ public abstract class AclServiceTestBase {
         asyncEventsWaiter.awaitEventsConsumption();
 
         asyncEventsWaiter.awaitEventsConsumption();
-
+        Thread.sleep(1000);
         // Then
         newInterfaceWithIcmpAclCheck();
         LOG.info("newInterfaceWithIcmpAcl - end");
@@ -411,7 +410,7 @@ public abstract class AclServiceTestBase {
         asyncEventsWaiter.awaitEventsConsumption();
 
         asyncEventsWaiter.awaitEventsConsumption();
-
+        Thread.sleep(1000);
         // Then
         newInterfaceWithDstPortRangeCheck();
         LOG.info("newInterfaceWithDstPortRange - end");
@@ -420,7 +419,6 @@ public abstract class AclServiceTestBase {
     abstract void newInterfaceWithDstPortRangeCheck();
 
     @Test
-    @Ignore
     public void newInterfaceWithDstAllPorts() throws Exception {
         LOG.info("newInterfaceWithDstAllPorts - start");
 
@@ -447,7 +445,7 @@ public abstract class AclServiceTestBase {
         asyncEventsWaiter.awaitEventsConsumption();
 
         asyncEventsWaiter.awaitEventsConsumption();
-
+        Thread.sleep(1000);
         // Then
         newInterfaceWithDstAllPortsCheck();
         LOG.info("newInterfaceWithDstAllPorts - end");
@@ -493,7 +491,7 @@ public abstract class AclServiceTestBase {
         asyncEventsWaiter.awaitEventsConsumption();
 
         asyncEventsWaiter.awaitEventsConsumption();
-
+        Thread.sleep(1000);
         // Then
         newInterfaceWithTwoAclsHavingSameRulesCheck();
         LOG.info("newInterfaceWithTwoAclsHavingSameRules - end");
@@ -519,7 +517,7 @@ public abstract class AclServiceTestBase {
         asyncEventsWaiter.awaitEventsConsumption();
 
         asyncEventsWaiter.awaitEventsConsumption();
-
+        Thread.sleep(1000);
         // Then
         newInterfaceWithIcmpAclCheck();
     }
@@ -545,7 +543,7 @@ public abstract class AclServiceTestBase {
         asyncEventsWaiter.awaitEventsConsumption();
 
         asyncEventsWaiter.awaitEventsConsumption();
-
+        Thread.sleep(1000);
         // Then
         newInterfaceWithAapIpv4AllCheck();
         LOG.info("newInterfaceWithAapIpv4All test - end");
@@ -572,7 +570,7 @@ public abstract class AclServiceTestBase {
         asyncEventsWaiter.awaitEventsConsumption();
 
         asyncEventsWaiter.awaitEventsConsumption();
-
+        Thread.sleep(1000);
         // Then
         newInterfaceWithAapCheck();
         LOG.info("newInterfaceWithAap test - end");