From f5188ff2147517612b410ed607e3843cdf4b51a6 Mon Sep 17 00:00:00 2001 From: Ilya Maximets Date: Wed, 19 Jul 2023 12:33:03 +0200 Subject: [PATCH] daemon.at: Correctly terminate ovsdb process in a backtrace test. 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.") Acked-by: Ales Musil Acked-by: Eelco Chaudron Signed-off-by: Ilya Maximets --- 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