Skip to content

Commit

Permalink
daemon.at: Correctly terminate ovsdb process in a backtrace test.
Browse files Browse the repository at this point in the history
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: 759a29d ("backtrace: Extend the backtrace functionality.")
Acked-by: Ales Musil <[email protected]>
Acked-by: Eelco Chaudron <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
  • Loading branch information
igsilya committed Jul 19, 2023
1 parent 24520a4 commit f5188ff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/daemon.at
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit f5188ff

Please sign in to comment.