Skip to content

ci: run the fuse_mount suite against a real mount on the runner - #594

Merged
scttfrdmn merged 6 commits into
mainfrom
fix/543-fuse-mount-job
Oct 8, 2026
Merged

scttfrdmn merged 6 commits into
mainfrom
fix/543-fuse-mount-job

Conversation

@scttfrdmn

@scttfrdmn scttfrdmn commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Fixes #543.

#543 asked to run the fuse_mount suite on the runner, read the result, record it, and only then decide on a gate. All three are done here. Becoming a required check is a branch-protection change, so that's left as a separate decision.

1. A fuse-mount job

It reports /dev/fuse, fusermount3 and the kernel first. Then it finds the tests that exist only under -tags=fuse_mount (go test -list diffed with and without the tag) and requires a --- PASS line for each. It doesn't name the tests: a build-tag suite can pass by running nothing if the tag stops selecting its file, and an empty tag-only set fails the job. The job runs go test with -timeout 5m.

2. What the first run found: a real defect

Every first read(2) returned EIO. The cause was a nil-pointer panic in FileHandle.Read (fh.fs.cache.Get), which go-fuse recovers and answers as EIO. liveMount passes a nil cache. This package disagreed with itself about nil: the metadata cache helpers check for it, but the data path and the read-ahead worker don't.

  • Fix: NewFileSystem substitutes noCache, which misses every Get. A nil cache now means "no cache" at every call site, including future ones.
  • Shipped mounts weren't affected. The adapter always passes a cache from cache.NewFromConfig, which returns a cache or an error.
  • TestNilCacheReadsThroughToTheBackend reproduces the panic without a mount (verified before the fix), so it runs everywhere. Removing the substitution brings the nil dereference back.

The same run also hung for ten minutes: TestKeepCacheSurvivesReopen left its first descriptor open when a read failed, so the cleanup's unmount got EBUSY. It's now closed on the failure path too.

3. With the fix: all four subtests pass, and the suite fails when it should

On ubuntu-24.04, kernel 6.17.0-1022-azure, non-root through fusermount3's setuid path, all four subtests pass.

Mutation, run on CI (commit 1df0a57, reverted in 3bb4138): openFlags() returning 0, so no flag reaches the kernel.

Subtest With the flag sent With no flag sent (mutation)
direct_io: both reads reach the filesystem ✅ ❌ 1 READ, needs ≥ 2
without direct_io: page cache serves the 2nd read ✅ ✅ (correct, it's the default)
keep_cache: reopened read served from page cache ✅ ❌ 1 READ, needs 0
without keep_cache: reopen drops the cache ✅ ✅ (correct)

That's #180's defect class (a mount option that's accepted and never reaches the kernel), and nothing else in the repo can observe it. The results are recorded in kernel_options_live_test.go's doc comment, the artifact #543 named.

Also

  • The build-tags comment and the Makefile no longer say the suite is run by nothing.
  • make test-fuse-mount drops its hardcoded -run 'TestDirectIO|TestKeepCache', which would have silently skipped a third live test.

Not done: making fuse-mount required

It now reports on every PR, but a red result doesn't block a merge until branch protection lists fuse-mount. Proposed after this merges, with the same append-only call used for the fuzz cells:

gh api -X POST repos/scttfrdmn/objectfs/branches/main/protection/required_status_checks/contexts -f "contexts[]=fuse-mount"

🤖 Generated with Claude Code

internal/fuse/kernel_options_live_test.go is the only test that observes the
kernel's half of FOPEN_DIRECT_IO and FOPEN_KEEP_CACHE, by counting READ
requests through a real mount. It sat behind the fuse_mount tag, run by
nothing, because a comment said ubuntu-latest had no /dev/fuse. It has one,
and the suite needs nothing else (liveMount uses the in-process substrate
endpoint).

New fuse-mount job: reports /dev/fuse, fusermount3 and the kernel, then runs
every test that exists only under -tags=fuse_mount, found with go test -list
rather than named, and requires each to report PASS. A build-tag suite can
pass by running nothing when the tag stops selecting the file; this turns
that into a failure.
…stead of panicking (#543)

The first CI run of the fuse_mount suite (previous commit) failed every
read(2) with EIO. The cause was a nil-pointer panic in FileHandle.Read
(filesystem.go:1066, fh.fs.cache.Get), which go-fuse recovers and answers
as EIO. liveMount passes a nil cache, NewFileSystem stored it as given, and
this package disagreed with itself about what nil meant: the metadata cache
helpers check for it, while the data path (FileHandle.Read, the backend
read helper, and the read-ahead worker) does not.

The adapter always passes a cache from cache.NewFromConfig, which returns a
cache or an error, so no shipped mount was affected. The constructor's
contract was the defect, and the live suite was its first nil caller.

NewFileSystem now substitutes noCache, which holds nothing and misses every
Get, so a nil cache means no cache at every call site, including future
ones. TestNilCacheReadsThroughToTheBackend reproduces the panic without a
mount (small read, repeat read, sequential run to reach read-ahead), so it
runs in the ordinary test job on every platform; removing the substitution
brings the nil dereference back.

Also from that run: TestKeepCacheSurvivesReopen closed its first descriptor
only after a successful read, so a failed read left it open, the unmount
failed EBUSY, and the job hung until its timeout canceled it. It is now
closed on the failure path too, and the job's go test has -timeout 5m so a
hang produces a goroutine dump instead of a silent cancellation.
… stop calling it unrun (#543)

The previous commit was a deliberate mutation (openFlags sending no flags)
and the one before it reverts that; neither changes the tree.

Results, now in kernel_options_live_test.go's doc comment, which #543 named
as the artifact either way:
- first run: every read EIO, from the nil-cache panic fixed in fb217f6
- after the fix: all four subtests pass on ubuntu-24.04, kernel
  6.17.0-1022-azure, through fusermount3's setuid path as non-root go test
- the mutation: direct_io saw 1 READ (needs >= 2) and keep_cache saw 1
  (needs 0) while both 'without' cases still passed, so the suite catches
  #180's class of a flag that never reaches the kernel

The build-tags comment and the Makefile no longer say the suite is run by
nothing. make test-fuse-mount drops its -run 'TestDirectIO|TestKeepCache'
list, which would have silently skipped a third live test; it runs the
package under the tag, as the CI job discovers tag-only tests itself.
@scttfrdmn
scttfrdmn merged commit 99cf288 into main Oct 8, 2026
55 checks passed
@scttfrdmn
scttfrdmn deleted the fix/543-fuse-mount-job branch October 8, 2026 03:59
scttfrdmn added a commit that referenced this pull request Oct 8, 2026
…heck (#595)

Branch protection on main now requires fuse-mount (#543, #594): 51 required
checks became 52, appended with POST to required_status_checks/contexts
after confirming the context reported success on main's head (99cf288).
The API's list diffed before and after: fuse-mount added, none removed.

requiredChecks gains the name and diffs clean against the API at 52.
Renaming the fuse-mount job now fails
TestRequiredChecksStillHaveAJobToReportThem, which it could not before.
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.

The fuse_mount suite is skipped for a device that ubuntu-latest has

1 participant