From cfdfbc3ebc2546f9dc38448d6d2e0aabff902e79 Mon Sep 17 00:00:00 2001 From: Lucas Molas Date: Mon, 13 Sep 2021 09:37:18 -0300 Subject: [PATCH] fix(sharness): add extra check in flush=false in files write --- test/sharness/t0250-files-api.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/sharness/t0250-files-api.sh b/test/sharness/t0250-files-api.sh index e2162cdf79e..08b9c6c11b2 100755 --- a/test/sharness/t0250-files-api.sh +++ b/test/sharness/t0250-files-api.sh @@ -508,6 +508,21 @@ test_files_api() { verify_dir_contents /cats file1 ipfs this ' + # Temporary check to uncover source of flaky test fail (see + # https://github.com/ipfs/go-ipfs/issues/8131 for more details). + # We suspect that sometimes the daemon isn't running when in fact we need + # it to for the `--flush=false` flag to take effect. To try to spot the + # specific error before it manifests itself in the failed test we explicitly + # poll the damon API when it should be running ($WITH_DAEMON set). + # Test taken from `test/sharness/lib/test-lib.sh` (but with less retries + # as the daemon is either running or not but there is no 'bootstrap' time + # needed in this case). + test_expect_success "'ipfs daemon' is running when WITH_DAEMON is set" ' + test -z "$WITH_DAEMON" || + pollEndpoint -host=$API_MADDR -v -tout=1s -tries=3 2>poll_apierr > poll_apiout || + test_fsh cat actual_daemon || test_fsh cat daemon_err || test_fsh cat poll_apierr || test_fsh cat poll_apiout + ' + test_expect_success "write 'no-flush' succeeds $EXTRA" ' echo "testing" | ipfs files write $ARGS $RAW_LEAVES -f=false -e /cats/walrus '