In a backtrace test with monitor the child process will be re-started
after being killed.  The test doesn't wait for that to happen, so it
is possible that during the test cleanup the pid in a pid file is not
updated yet.  Hence, the on-exit hook will not kill the process.

This is causing issues in Cirrus CI, because gmake on FreBSD waits for
all child processes to exit and that never happens.

Fix the issue by waiting for a new process.  It's also better to exit
gracefully instead of relying on the on-exit kill.

Fixes: 759a29dc2d97 ("backtrace: Extend the backtrace functionality.")
Signed-off-by: Ilya Maximets <[email protected]>
---
 tests/daemon.at | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/daemon.at b/tests/daemon.at
index 13cb8fc1c..2c7fac57c 100644
--- a/tests/daemon.at
+++ b/tests/daemon.at
@@ -284,4 +284,8 @@ AT_CHECK([kill -SEGV $child])
 OVS_WAIT_UNTIL([grep -q "backtrace(monitor)|WARN|SIGSEGV detected, backtrace:" 
ovsdb-server.log])
 OVS_WAIT_UNTIL([grep -q "daemon_unix(monitor)|ERR|1 crashes: pid .* died, 
killed (Segmentation fault)" ovsdb-server.log])
 
+# Wait until a new process is started before exiting, so it will be
+# stopped correctly.
+OVS_WAIT_UNTIL([test -s ovsdb-server.pid && test $(cat ovsdb-server.pid) != 
$child])
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 AT_CLEANUP
-- 
2.40.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to