diff mbox series

[ovs-dev,04/15] tests: tests fixed "Encaps tunnel cleanup ..." and "ovn-controller exit"

Message ID 20230918164714.3144984-5-xsimonar@redhat.com
State Superseded
Headers show
Series Fixed another set of flaky Unit Tests | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes fail github build: failed

Commit Message

Xavier Simonart Sept. 18, 2023, 4:47 p.m. UTC
Both tests were randomly failing as not properly checking that ovn-controller really exited.

Fixes: 4caf8da7e81b ("tests: fixed "Encaps tunnel cleanup does not interfere with multiple controller on the same host"")

Signed-off-by: Xavier Simonart <xsimonar@redhat.com>
---
 tests/ovn.at | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tests/ovn.at b/tests/ovn.at
index 9f35aef2b..3c4d266c5 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -19495,6 +19495,9 @@  OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected])
 # Stop ovn-controller on hv2
 as hv2 ovs-appctl -t ovn-controller exit
 
+# Make sure it's really stopped, as we will restart it later.
+OVS_WAIT_WHILE([kill -0 $(cat hv2/ovn-controller.pid) 2> /dev/null])
+
 # Now send the packet again. This time, it should not arrive.
 OVS_WAIT_UNTIL([as hv1 ovs-appctl -t ovn-controller inject-pkt "$packet"])
 
@@ -36263,7 +36266,9 @@  rm -f ${OVN_SYSCONFDIR}/system-id-override
 check ovn-appctl -t ovn-controller exit --restart
 
 # Make sure ovn-controller stopped before restarting it
-OVS_WAIT_UNTIL([test x$(ovn-appctl -t ovn-controller debug/status) != "xrunning"])
+# Checking the debug/status would not be not enough as the unixctl might be closed
+# but ovn-controller still finishing up cleaning.
+OVS_WAIT_WHILE([kill -0 $(cat hv1/ovn-controller.pid) 2> /dev/null])
 
 # for some reason SSL ovsdb configuration overrides CLI, so
 # delete ssl config from ovsdb to give CLI arguments priority