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
Root-cause class behind #298 and #263. Surfaced by the integration review of PR #300.
The convention
Roughly a dozen test suites create scratch directories named .test-<id> in the live repository tree: .test-pir-832, .test-bugfix-298, and others. None of them are gitignored.
What it costs
It produces the #298 class directly. Anything that walks the repository, and npm pack --dry-run is the example that bit, can list one of these directories and then stat it after the owning test has removed it. That failed 5 of 5 gate approvals today and blocked four projects.
It puts test litter in git status. An untracked directory left behind by an interrupted run is indistinguishable from work in progress, and afx spawn refuses a dirty tree.
It is how #297 happened, one level along: untracked directories in the main checkout that no builder worktree has, because git worktree add does not copy untracked files. A test asserting on the live tree is then green everywhere except the one place gates run.
What would close this
Add .test-*/ to .gitignore. Cheap, and stops the litter being visible to git status and to anything reading tracked state.
Better: put scratch directories under the system temp directory rather than the repository. mkdtemp is already the pattern in several suites, including the fix in Fix #298: derive the pack list from git, not from a live-tree walk #300. Nothing that walks the repo can then observe them at all.
The second is the real fix. The first is worth doing today regardless, because it is one line.
Root-cause class behind #298 and #263. Surfaced by the integration review of PR #300.
The convention
Roughly a dozen test suites create scratch directories named
.test-<id>in the live repository tree:.test-pir-832,.test-bugfix-298, and others. None of them are gitignored.What it costs
It produces the #298 class directly. Anything that walks the repository, and
npm pack --dry-runis the example that bit, can list one of these directories and then stat it after the owning test has removed it. That failed 5 of 5 gate approvals today and blocked four projects.It puts test litter in
git status. An untracked directory left behind by an interrupted run is indistinguishable from work in progress, andafx spawnrefuses a dirty tree.It is how #297 happened, one level along: untracked directories in the main checkout that no builder worktree has, because
git worktree adddoes not copy untracked files. A test asserting on the live tree is then green everywhere except the one place gates run.What would close this
.test-*/to.gitignore. Cheap, and stops the litter being visible togit statusand to anything reading tracked state.mkdtempis already the pattern in several suites, including the fix in Fix #298: derive the pack list from git, not from a live-tree walk #300. Nothing that walks the repo can then observe them at all.The second is the real fix. The first is worth doing today regardless, because it is one line.
Related