Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sharness: make t0180-p2p less racy #4310

Merged
merged 1 commit into from
Oct 17, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions test/sharness/t0180-p2p.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ test_expect_success 'start p2p listener' '
test_expect_success 'Test server to client communications' '
ma-pipe-unidir --listen --pidFile=listener.pid send /ip4/127.0.0.1/tcp/10101 < test0.bin &

go-sleep 500ms &&
test_wait_for_file 30 100ms listener.pid &&
kill -0 $(cat listener.pid) &&

ipfsi 1 p2p stream dial $PEERID_0 p2p-test /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log &&
Expand All @@ -53,7 +53,7 @@ test_expect_success 'Test server to client communications' '
test_expect_success 'Test client to server communications' '
ma-pipe-unidir --listen --pidFile=listener.pid recv /ip4/127.0.0.1/tcp/10101 > server.out &

go-sleep 500ms &&
test_wait_for_file 30 100ms listener.pid &&
kill -0 $(cat listener.pid) &&

ipfsi 1 p2p stream dial $PEERID_0 p2p-test /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log &&
Expand Down Expand Up @@ -94,7 +94,8 @@ test_expect_success "Setup: Idle stream" '
ipfsi 1 p2p stream dial $PEERID_0 p2p-test /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log &&
ma-pipe-unidir --pidFile=client.pid recv /ip4/127.0.0.1/tcp/10102 &

go-sleep 500ms &&
test_wait_for_file 30 100ms listener.pid &&
test_wait_for_file 30 100ms client.pid &&
kill -0 $(cat listener.pid) && kill -0 $(cat client.pid)
'

Expand Down Expand Up @@ -127,7 +128,8 @@ test_expect_success "Setup: Idle stream(2)" '
ipfsi 1 p2p stream dial $PEERID_0 p2p-test2 /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log &&
ma-pipe-unidir --pidFile=client.pid recv /ip4/127.0.0.1/tcp/10102 &

go-sleep 500ms &&
test_wait_for_file 30 100ms listener.pid &&
test_wait_for_file 30 100ms client.pid &&
kill -0 $(cat listener.pid) && kill -0 $(cat client.pid)
'

Expand Down