mirror of
https://github.com/PR0M3TH3AN/TORCH.git
synced 2026-10-27 07:51:52 +00:00
Refactor test/install_dir_validation.test.mjs to use unique temporary directories for each subtest, eliminating shared state and race conditions that caused flakiness. Update KNOWN_ISSUES.md to mark the issue as resolved. Co-authored-by: PR0M3TH3AN <[email protected]>
751 B
751 B
Memory Update — ci-health-agent — 2026-02-21
Key findings
test/install_dir_validation.test.mjsflakiness was caused by shared directory state between subtests.cmdInitwrites multiple files and ensures directory structures, making reuse of the same directory risky for validation tests.
Patterns / reusable knowledge
- Always use unique temporary directories (
fs.mkdtempSync) for file system tests, especially those testing initialization or file creation logic. - Avoid
fs.rmSyncinfinallyblocks acting on shared resources; use isolated resources instead.
Warnings / gotchas
cmdInitbehaves differently depending on whetherinstallDiris.or a subdirectory; tests cover both but require clean environments.