This commit fixes the intermittent test failure caused by the
race between the test thread and logging thread.

Signed-off-by: Alex Wang <al...@nicira.com>

---
PATCH->v2:
- fix incorrect use of autotest macro.
---
 tests/ovs-vsctl.at |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/ovs-vsctl.at b/tests/ovs-vsctl.at
index f6e6994..5007c5b 100644
--- a/tests/ovs-vsctl.at
+++ b/tests/ovs-vsctl.at
@@ -1242,6 +1242,8 @@ m4_foreach(
 AT_CHECK([ovs-vsctl add-port br0 reserved_name], [0], [], [dnl
 ovs-vsctl: Error detected while setting up 'reserved_name'.  See ovs-vswitchd 
log for details.
 ])
+# Prevent race.
+OVS_WAIT_UNTIL([test `grep -- "|WARN|" ovs-vswitchd.log | wc -l` -ge 1])
 # Detect the warning log message
 AT_CHECK([sed -n "s/^.*\(|bridge|WARN|.*\)$/\1/p" ovs-vswitchd.log], [0], [dnl
 |bridge|WARN|could not create interface reserved_name, name is reserved
@@ -1280,6 +1282,8 @@ m4_foreach(
 AT_CHECK([ovs-vsctl add-port br0 reserved_name], [0], [], [dnl
 ovs-vsctl: Error detected while setting up 'reserved_name'.  See ovs-vswitchd 
log for details.
 ])
+# Prevent race.
+OVS_WAIT_UNTIL([test `grep -- "|WARN|" ovs-vswitchd.log | wc -l` -ge 1])
 # Detect the warning log message
 AT_CHECK([sed -n "s/^.*\(|bridge|WARN|.*\)$/\1/p" ovs-vswitchd.log], [0], [dnl
 |bridge|WARN|could not create interface reserved_name, name is reserved
-- 
1.7.9.5

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to