diff --git a/test/sharness/lib/iptb-lib.sh b/test/sharness/lib/iptb-lib.sh index 94475b7ae..e9699ea3e 100644 --- a/test/sharness/lib/iptb-lib.sh +++ b/test/sharness/lib/iptb-lib.sh @@ -56,3 +56,9 @@ startup_cluster() { ' done } + +iptb_wait_stop() { + while ! iptb for-each sh -c '! { test -e "$IPFS_PATH/repo.lock" && fuser -f "$IPFS_PATH/repo.lock" >/dev/null; }'; do + go-sleep 10ms + done +} diff --git a/test/sharness/t0125-twonode.sh b/test/sharness/t0125-twonode.sh index 342cf1c4f..5af4d4d97 100755 --- a/test/sharness/t0125-twonode.sh +++ b/test/sharness/t0125-twonode.sh @@ -81,7 +81,7 @@ run_advanced_test() { ' test_expect_success "shut down nodes" ' - iptb stop + iptb stop && iptb_wait_stop ' } diff --git a/test/sharness/t0130-multinode.sh b/test/sharness/t0130-multinode.sh index 7620b8911..cf5b9044f 100755 --- a/test/sharness/t0130-multinode.sh +++ b/test/sharness/t0130-multinode.sh @@ -67,7 +67,7 @@ run_basic_test() { run_single_file_test test_expect_success "shut down nodes" ' - iptb stop + iptb stop && iptb_wait_stop ' } @@ -79,7 +79,7 @@ run_advanced_test() { run_random_dir_test test_expect_success "shut down nodes" ' - iptb stop || + iptb stop && iptb_wait_stop || test_fsh tail -n +1 .iptb/*/daemon.std* ' } diff --git a/test/sharness/t0182-circuit-relay.sh b/test/sharness/t0182-circuit-relay.sh index a6e888ee4..4f48827a3 100755 --- a/test/sharness/t0182-circuit-relay.sh +++ b/test/sharness/t0182-circuit-relay.sh @@ -21,6 +21,7 @@ test_expect_success 'configure EnableRelayHop in relay node' ' test_expect_success 'restart nodes' ' iptb stop && + iptb_wait_stop && iptb start --args --routing=none '