You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test flake: TestNoGeneratedPolicyReachesTheStagingBucket walks dist/ while TestReleaseBuildLeavesTheTreeClean creates and removes it #1334
make check failed once on an unmodified tree, on the branch for spawn#1225/#1226/#1205 at 121e3d5, with this:
--- FAIL: TestNoGeneratedPolicyReachesTheStagingBucket (0.05s)
staging_scan_test.go:92: lstat ../../dist: no such file or directory
FAIL github.com/spore-host/spawn/pkg/taskiam
Running the test again on its own passed (go test -count=1 -run TestNoGeneratedPolicyReachesTheStagingBucket ./pkg/taskiam/). There was no dist/ in the checkout either before or after.
I think this is a cross-package race, but I worked it out from the code and haven't reproduced it on purpose:
TestReleaseBuildLeavesTheTreeClean (release_tree_clean_test.go, root package) creates files at the real dist/ paths it discovers from .goreleaser.yaml (line 204 MkdirAll, 207 WriteFile). It removes them in t.Cleanup (line 210 RemoveAll).
TestNoGeneratedPolicyReachesTheStagingBucket (pkg/taskiam/staging_scan_test.go) runs filepath.Walk("../..") over the same checkout, and go test ./... runs the two packages in parallel. Its skip list is .git, node_modules, vendor, testdata, which leaves out dist, so it reads the root, sees dist, and then the Lstat fails once the root test has removed it. Its walk callback returns werr, which turns that into a test failure.
The other repo-walking tests already skip dist: bot_principal_test.go:129, cmd/spored_unit_test.go:46, cmd/spored_unit_nnp_test.go:45 and no_hardcoded_account_subdomain_test.go:55.
Possible fixes:
Add "dist" to the taskiam walk's skip list. This is the minimal change, and dist/ holds build output, not source.
Or have the walk ignore fs.ErrNotExist for entries that vanish mid-walk.
The first is narrower. Either way, the root cause is that a test writes into the shared checkout, and any other tree-walking test could hit the same race.
Activity
test: release-tree gate probes a temp work tree; every tree walk tole…
fix: tree-walk test flake (#1334); discard per-instance state inherit…
test(cost): tolerate entries vanishing mid-walk (#1334 gate)
fix(cost): --cost-limit counts public IPv4, EBS IOPS/throughput and l…
test(mpi): tolerate vanished entries in the /tmp leftovers walk (#1334)
test(mpi): tolerate vanished entries in the /tmp leftovers walk (#1334)
test(mpi): tolerate vanished entries in the /tmp leftovers walk (#1334)
test(mpi): tolerate vanished entries in the /tmp leftovers walk (#1334)
fix(mpi): --efa installs a pinned, sha256-checked EFA installer, sign…