Skip to content

test(forge): skip entries removed mid-walk in the owner sentinel scan (RIG-5408) - #2289

Merged
mattwilkinsonn merged 1 commit into
mainfrom
compass-forge/rig-5408-sentinel-walk-enoent
Oct 15, 2026
Merged

mattwilkinsonn merged 1 commit into
mainfrom
compass-forge/rig-5408-sentinel-walk-enoent

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes RIG-5408. TestOwnerSentinelSingleChokepoint walks go/. Meanwhile guestd's TestExecResolvesRelativePATHFromWorkdir creates and deletes guest-relative-path-* inside the source tree. If the walk lists that dir and then opens it after deletion, it fails with ENOENT (seen on #2285, run 38407100289).

  • The walk moves into sentinelFiles and skips fs.ErrNotExist, both from WalkDir and from the file read. The scan only checks non-test .go files, so a vanished entry never matters.
  • New TestSentinelFilesSkipsEntriesRemovedMidWalk: deletes a listed directory and a listed file during the walk.

Test-only change.

Tests

  • Red before the fix: sentinelFiles: open …/b: no such file or directory.
  • Green after: both tests pass 20/20 (-count=20). The full go/internal/forge package passes.
  • gofmt, go vet, golangci-lint (forge): clean.

… (RIG-5408)

The chokepoint scan walks go/ while other packages' tests create and
delete temp dirs there; a vanished entry failed the walk with ENOENT.
Skip fs.ErrNotExist, with a regression test that removes a listed dir
and file mid-walk.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@trunk-io

trunk-io Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@linear-code

linear-code Bot commented Oct 13, 2026

Copy link
Copy Markdown

RIG-5408

@github-actions

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-forge-rig-5408-senti.compass-eng-docs.pages.dev

Deployed from compass-forge/rig-5408-sentinel-walk-enoent at a11a855.

@rigel-mintaka
rigel-mintaka marked this pull request as ready for review October 13, 2026 14:44
@rigel-mintaka

Copy link
Copy Markdown
Contributor Author

Review result

  • Reviewed SHA: a11a8558b7500a9ab6c34d926e25a293c906bbf0
  • Base: main@origin b1e851565e7d
  • Result: high 0 / medium 0 / low 0. All-clear.

Findings checked

  • The regression test covers both ways an entry can vanish. While a.go is being read, the test removes b/ and c.go.
    • Removing b/ makes WalkDir's later ReadDir return fs.ErrNotExist.
    • Removing c.go makes the injected read return fs.ErrNotExist.
    • Dropping either skip makes the test fail. Without the fix it fails with open …/b: no such file or directory.
  • A real chokepoint violation is still caught. Errors other than fs.ErrNotExist still fail the walk, and the scan still requires exactly owner.go. The only entries skipped are ones deleted during the run. Those are other tests' temp dirs, which contain no .go source.
  • Verification:
    • Both tests pass 20/20 (-count=20), and the full go/internal/forge package passes.
    • gofmt, go vet and golangci-lint are clean.
    • CI is green on this head.

@mattwilkinsonn
mattwilkinsonn merged commit 5207da8 into main Oct 15, 2026
17 checks passed
@mattwilkinsonn
mattwilkinsonn deleted the compass-forge/rig-5408-sentinel-walk-enoent branch October 15, 2026 01:57
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