Tests were sometimes failing because expected async notifications from switch were being checked for too quickly and with no timeout
=> Added small time delay before checking for async notifications from switch
diff --git a/tests/flow_query.py b/tests/flow_query.py
index 6044758..bad4749 100644
--- a/tests/flow_query.py
+++ b/tests/flow_query.py
@@ -62,6 +62,7 @@
import unittest
import random
+import time
import oftest.controller as controller
import oftest.cstruct as ofp
@@ -1562,6 +1563,9 @@
return result
+ def settle(self):
+ time.sleep(2)
+
# FLOW ADD 5
#
# OVERVIEW
@@ -1652,6 +1656,8 @@
result = True
+ sw.settle() # Allow switch to settle and generate any notifications
+
# Check for any error messages
if not sw.errors_verify(0):
@@ -1757,6 +1763,8 @@
result = True
+ sw.settle() # Allow switch to settle and generate any notifications
+
# Check for any error messages
if not sw.errors_verify(0):
@@ -1863,6 +1871,8 @@
result = True
+ sw.settle() # Allow switch to settle and generate any notifications
+
# Check for any error messages
if not sw.errors_verify(0):
@@ -1895,6 +1905,8 @@
self.assertTrue(sw.barrier(), "Barrier failed")
+ sw.settle() # Allow switch to settle and generate any notifications
+
# Check for expected error message
if not sw.errors_verify(1, \
@@ -2012,6 +2024,8 @@
result = True
+ sw.settle() # Allow switch to settle and generate any notifications
+
# Check for any error messages
if not sw.errors_verify(0):
@@ -2141,6 +2155,8 @@
result = True
+ sw.settle() # Allow switch to settle and generate any notifications
+
# Check for expected error message
if not sw.errors_verify(1, \
@@ -2257,6 +2273,8 @@
result = True
+ sw.settle() # Allow switch to settle and generate any notifications
+
# Check for any error messages
if not sw.errors_verify(0):
@@ -2355,6 +2373,8 @@
result = True
+ sw.settle() # Allow switch to settle and generate any notifications
+
# Check for any error messages
if not sw.errors_verify(0):
@@ -2414,6 +2434,8 @@
# Do barrier, to make sure all flows are in
self.assertTrue(sw.barrier(), "Barrier failed")
+ sw.settle() # Allow switch to settle and generate any notifications
+
# Check for error message
if not sw.errors_verify(0):
@@ -2509,6 +2531,8 @@
result = True
+ sw.settle() # Allow switch to settle and generate any notifications
+
# Check for any error messages
if not sw.errors_verify(0):
@@ -2600,6 +2624,8 @@
result = True
+ sw.settle() # Allow switch to settle and generate any notifications
+
# Check for any error messages
if not sw.errors_verify(0):
@@ -2621,6 +2647,8 @@
self.assertTrue(sw.barrier(), "Barrier failed")
+ sw.settle() # Allow switch to settle and generate any notifications
+
# Check for any error messages
if not sw.errors_verify(0):
@@ -2731,6 +2759,8 @@
result = True
+ sw.settle() # Allow switch to settle and generate any notifications
+
# Check for any error messages
if not sw.errors_verify(0):
@@ -2827,6 +2857,8 @@
result = True
+ sw.settle() # Allow switch to settle and generate any notifications
+
# Check for any error messages
if not sw.errors_verify(0):
@@ -2886,6 +2918,8 @@
# Do barrier, to make sure all flows are in
self.assertTrue(sw.barrier(), "Barrier failed")
+ sw.settle() # Allow switch to settle and generate any notifications
+
# Check for error message
if not sw.errors_verify(0):
@@ -3006,6 +3040,8 @@
result = True
+ sw.settle() # Allow switch to settle and generate any notifications
+
# Check for expected "removed" message
if not sw.errors_verify(0):