@cryptotaxi247 / kubo / commits / bb4949217

fix(sharness): add extra check in flush=false in files write

(cherry picked from commit cfdfbc3ebc2546f9dc38448d6d2e0aabff902e79)

Lucas Molas committed Sep 13, 2021 at 09:37 UTC bb494921741816cd176728952810714330ee5673
1 file changed +15
test/sharness/t0250-files-api.sh
+15
@@ -508,6 +508,21 @@ test_files_api() {
508 verify_dir_contents /cats file1 ipfs this
509 '
510
511 + # Temporary check to uncover source of flaky test fail (see
512 + # https://github.com/ipfs/go-ipfs/issues/8131 for more details).
513 + # We suspect that sometimes the daemon isn't running when in fact we need
514 + # it to for the `--flush=false` flag to take effect. To try to spot the
515 + # specific error before it manifests itself in the failed test we explicitly
516 + # poll the damon API when it should be running ($WITH_DAEMON set).
517 + # Test taken from `test/sharness/lib/test-lib.sh` (but with less retries
518 + # as the daemon is either running or not but there is no 'bootstrap' time
519 + # needed in this case).
520 + test_expect_success "'ipfs daemon' is running when WITH_DAEMON is set" '
521 + test -z "$WITH_DAEMON" ||
522 + pollEndpoint -host=$API_MADDR -v -tout=1s -tries=3 2>poll_apierr > poll_apiout ||
523 + test_fsh cat actual_daemon || test_fsh cat daemon_err || test_fsh cat poll_apierr || test_fsh cat poll_apiout
524 + '
525 +
526 test_expect_success "write 'no-flush' succeeds $EXTRA" '
527 echo "testing" | ipfs files write $ARGS $RAW_LEAVES -f=false -e /cats/walrus
528 '