Skip to content

test: fix MFS timeout and concurrent migration tests [skip changelog] - #11499

Merged
dennis-tra merged 2 commits into
masterfrom
test/fix-flaky-cli-tests
Nov 24, 2026
Merged

dennis-tra merged 2 commits into
masterfrom
test/fix-flaky-cli-tests

Conversation

@dennis-tra

Copy link
Copy Markdown
Contributor

Fixes two CLI tests that failed in a local make test_cli run on the v0.43.2 release branch. Both tests are the same on master. Only test files change.

TestMFSTimeoutOnMissingBlock fails every time

The test builds a 1 MiB file from repeated "z" bytes, removes its leaf blocks, and expects files read / files write to fail. All leaves have the same well-known CID, QmeAMsgaKpR6s5R5Hgd2WRnQxooFN1rCyUCdnhHMTkizJm, and public providers serve it (delegated-ipfs.dev lists Pinata over bitswap and HTTP). The harness clears Bootstrap and turns off mDNS, but Routing.Type stays auto, so the daemon finds the provider through delegated routing, fetches the "missing" blocks, and the commands succeed.

The test now uses random.Bytes, so no other node has the blocks.

TestConcurrentMigrations fails under load

The test started a second daemon --migrate 2s after the first one, then asserted that no .tmp-* files exist. The second daemon fails on repo.lock before it writes anything, but the first daemon may still be migrating. In the failing run, the leftover file was the first daemon's .tmp-config.16-to-17.bak* backup, which was still being written. That daemon never started its API within the 30s context.

The test now waits until the repo version file reaches RepoVersion before it checks for temp files. The check still catches files left behind by either daemon.

How I checked it

  • TestMFSTimeoutOnMissingBlock: failed every run before the change, passed 2 of 2 after.
  • TestConcurrentMigrations: passed 3 of 3 normally and 5 of 5 with all CPU cores busy. I could not reproduce the original failure locally, even after cutting the startup wait to 100ms, so no run shows the fix against the exact failure.
  • go vet and gofmt are clean. make test_go_lint reports one existing issue in fuse/node/mount_darwin.go, which this PR does not touch.

References

The test removed the leaves of a file made of repeated "z" bytes. Those
leaf CIDs are well known and public providers serve them, so the
daemon fetched the "missing" blocks through delegated routing and the
read and write succeeded. Random content keeps the blocks unreachable.
The check ran while the first daemon could still be migrating, and
failed on the temporary backup file it was writing. Wait for the repo
to reach the latest version first.
@dennis-tra
dennis-tra requested a review from a team as a code owner November 24, 2026 11:05

@iand iand left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dennis-tra
dennis-tra merged commit fc3b35a into master Nov 24, 2026
27 checks passed
@dennis-tra
dennis-tra deleted the test/fix-flaky-cli-tests branch November 24, 2026 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants