Unverified 提交 77052409 作者: Steven Allen 提交者: GitHub

Merge pull request #5315 from ipfs/fix/5272

wait for the nodes to fully stop
...@@ -47,9 +47,9 @@ ...@@ -47,9 +47,9 @@
"version": "0.1.3" "version": "0.1.3"
}, },
{ {
"hash": "QmPCdWsL88nB7fzvhLRhBMo1QVLtt6Vm7ee7N9ZoUsqpPL", "hash": "QmR6BuYN4nWLxm5E3WtwvSwRGR9ZHjrNPoqXYM63z98swp",
"name": "iptb", "name": "iptb",
"version": "1.3.3" "version": "1.3.5"
}, },
{ {
"hash": "QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8", "hash": "QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8",
......
...@@ -56,3 +56,9 @@ startup_cluster() { ...@@ -56,3 +56,9 @@ startup_cluster() {
' '
done 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
}
...@@ -13,7 +13,7 @@ test_init_ipfs ...@@ -13,7 +13,7 @@ test_init_ipfs
test_launch_ipfs_daemon test_launch_ipfs_daemon
test_expect_success "shutdown succeeds" ' test_expect_success "shutdown succeeds" '
ipfs shutdown ipfs shutdown || true # bug: https://github.com/ipfs/go-ipfs/issues/4055
' '
test_expect_success "daemon no longer running" ' test_expect_success "daemon no longer running" '
...@@ -27,7 +27,7 @@ test_expect_success "daemon no longer running" ' ...@@ -27,7 +27,7 @@ test_expect_success "daemon no longer running" '
test_launch_ipfs_daemon --offline test_launch_ipfs_daemon --offline
test_expect_success "shutdown succeeds" ' test_expect_success "shutdown succeeds" '
ipfs shutdown ipfs shutdown || true # bug: https://github.com/ipfs/go-ipfs/issues/4055
' '
test_expect_success "daemon no longer running" ' test_expect_success "daemon no longer running" '
......
...@@ -81,7 +81,7 @@ run_advanced_test() { ...@@ -81,7 +81,7 @@ run_advanced_test() {
' '
test_expect_success "shut down nodes" ' test_expect_success "shut down nodes" '
iptb stop iptb stop && iptb_wait_stop
' '
} }
......
...@@ -67,7 +67,7 @@ run_basic_test() { ...@@ -67,7 +67,7 @@ run_basic_test() {
run_single_file_test run_single_file_test
test_expect_success "shut down nodes" ' test_expect_success "shut down nodes" '
iptb stop iptb stop && iptb_wait_stop
' '
} }
...@@ -79,7 +79,7 @@ run_advanced_test() { ...@@ -79,7 +79,7 @@ run_advanced_test() {
run_random_dir_test run_random_dir_test
test_expect_success "shut down nodes" ' test_expect_success "shut down nodes" '
iptb stop || iptb stop && iptb_wait_stop ||
test_fsh tail -n +1 .iptb/*/daemon.std* test_fsh tail -n +1 .iptb/*/daemon.std*
' '
} }
......
...@@ -51,10 +51,6 @@ reprovide() { ...@@ -51,10 +51,6 @@ reprovide() {
' '
} }
test_expect_success 'stop peer 1' '
iptb stop 1
'
# Test 'all' strategy # Test 'all' strategy
init_strategy 'all' init_strategy 'all'
......
...@@ -61,7 +61,7 @@ test_expect_success "start nodes" ' ...@@ -61,7 +61,7 @@ test_expect_success "start nodes" '
' '
test_expect_success "try connecting node in public network with priv networks" ' test_expect_success "try connecting node in public network with priv networks" '
iptb connect --timeout=2s [1-4] 0 test_must_fail iptb connect --timeout=2s [1-4] 0
' '
test_expect_success "node 0 (public network) swarm is empty" ' test_expect_success "node 0 (public network) swarm is empty" '
...@@ -70,7 +70,7 @@ test_expect_success "node 0 (public network) swarm is empty" ' ...@@ -70,7 +70,7 @@ test_expect_success "node 0 (public network) swarm is empty" '
' '
test_expect_success "try connecting nodes in different private networks" ' test_expect_success "try connecting nodes in different private networks" '
iptb connect 2 3 test_must_fail iptb connect 2 3
' '
test_expect_success "node 3 (pnet 2) swarm is empty" ' test_expect_success "node 3 (pnet 2) swarm is empty" '
......
...@@ -21,6 +21,7 @@ test_expect_success 'configure EnableRelayHop in relay node' ' ...@@ -21,6 +21,7 @@ test_expect_success 'configure EnableRelayHop in relay node' '
test_expect_success 'restart nodes' ' test_expect_success 'restart nodes' '
iptb stop && iptb stop &&
iptb_wait_stop &&
iptb start --args --routing=none iptb start --args --routing=none
' '
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论