Commit cf797d3d authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

sharness: only send kill signal once - #1106

sharness should only send the kill signal once, as that is
what a graceful shutdown should do. in the event that doesn't
happen, we should send it again, and then kill -9 to prevent it
lingering and messing with other tests.
parent bd9e2c6e
......@@ -236,13 +236,22 @@ test_launch_ipfs_daemon_and_mount() {
}
test_kill_repeat_10_sec() {
# try to shut down once + wait for graceful exit
kill $1
for i in 1 2 3 4 5 6 7 8 9 10
do
kill $1
sleep 1
! kill -0 $1 2>/dev/null && return
done
! kill -0 $1 2>/dev/null
# if not, try once more, which will skip graceful exit
kill $1
sleep 1
! kill -0 $1 2>/dev/null && return
# ok, no hope. kill it to prevent it messing with other tests
kill -9 $1 2>/dev/null
return 1
}
test_kill_ipfs_daemon() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment