From bd9e2c6edb88008edfd5ca5a228317b94e53b051 Mon Sep 17 00:00:00 2001 From: Juan Batiz-Benet Date: Tue, 21 Apr 2015 01:12:04 -0700 Subject: [PATCH 1/2] sharness: t0030-mount output known breakage The test_must_fail check fails on osx. (it does not seem to fail on linux). See #1109 --- test/sharness/t0030-mount.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sharness/t0030-mount.sh b/test/sharness/t0030-mount.sh index 1e2940073..1386275ef 100755 --- a/test/sharness/t0030-mount.sh +++ b/test/sharness/t0030-mount.sh @@ -24,7 +24,7 @@ test_expect_success "'ipfs mount' fails when there is no mount dir" ' test_must_fail ipfs mount -f=not_ipfs -n=not_ipns >output 2>output.err ' -test_expect_success "'ipfs mount' output looks good" ' +test_expect_failure "'ipfs mount' output looks good" ' test_must_be_empty output && test_should_contain "not_ipns\|not_ipfs" output.err ' From cf797d3d02dd7ddc7c44892551d9e7f2f190e40b Mon Sep 17 00:00:00 2001 From: Juan Batiz-Benet Date: Tue, 21 Apr 2015 00:24:55 -0700 Subject: [PATCH 2/2] 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. --- test/sharness/lib/test-lib.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/sharness/lib/test-lib.sh b/test/sharness/lib/test-lib.sh index 4be9aa434..4ca467033 100644 --- a/test/sharness/lib/test-lib.sh +++ b/test/sharness/lib/test-lib.sh @@ -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() {