Problem Statement
While the automated GitHub Actions CI runner on \windows-latest\ runs the entire test suite cleanly, developers running
pm test\ locally on Windows occasionally encounter \EPERM: operation not permitted\ errors during teardown of temporary project folders.
This happens because background file indexing, antivirus scanners, or lingering file descriptors temporarily lock directories before \s.rmSync(dir, { recursive: true })\ completes.
Objective
Make the local test runner completely resilient to transient Windows file locks so that
pm test\ runs 100% green on local developer machines without manual retries.
Scope of Work
- Safe Teardown Helper:
- Implement a shared test helper \safeRemoveDir(dir)\ that wraps directory cleanup with exponential retry and backoff (e.g. \s.rmSync(dir, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 })).
- File Handle Auditing:
- Verify that tests involving \SafeWriter, \JournaledTransaction, and git worktrees explicitly close file descriptors before invoking assertions or teardowns.
- Npm Cache / Sandbox Isolation:
- Ensure local temporary npm cache directories used during \install.test.js\ or \update.test.js\ avoid conflicting locks with the global user .npm\ cache.
Acceptance Criteria
Problem Statement
While the automated GitHub Actions CI runner on \windows-latest\ runs the entire test suite cleanly, developers running
pm test\ locally on Windows occasionally encounter \EPERM: operation not permitted\ errors during teardown of temporary project folders.
This happens because background file indexing, antivirus scanners, or lingering file descriptors temporarily lock directories before \s.rmSync(dir, { recursive: true })\ completes.
Objective
Make the local test runner completely resilient to transient Windows file locks so that
pm test\ runs 100% green on local developer machines without manual retries.
Scope of Work
Acceptance Criteria