fix(scripts): widen fixture-cleanup EPERM retry window
The failover Windows pool releases child-process and antivirus file handles slower than the hosted pool; a 1-second window (10 x 100 ms) still exhausts before release under load, so install-lefthook fixture cleanup threw EPERM in rmSync. A 10-second window (50 x 200 ms) covers the slower release without pinning afterEach cleanup, since a terminated child's handles drain once rather than reacquire.
This commit is contained in:
@@ -37,10 +37,13 @@ export function unlinkFixtureLinks(path: string): void {
|
|||||||
* Remove one fixture tree after its junctions are unlinked (see
|
* Remove one fixture tree after its junctions are unlinked (see
|
||||||
* {@link unlinkFixtureLinks}). Retries the removal: Windows releases child
|
* {@link unlinkFixtureLinks}). Retries the removal: Windows releases child
|
||||||
* process and antivirus file handles asynchronously, and an unretried
|
* process and antivirus file handles asynchronously, and an unretried
|
||||||
* `rmSync` fails immediately with EPERM under load.
|
* `rmSync` fails immediately with EPERM under load. A 10-second retry window
|
||||||
|
* (50 attempts × 200 ms) covers the failover pool's slow handle release;
|
||||||
|
* release is one-shot (a terminated child's handles drain, not reacquired),
|
||||||
|
* so a bounded window suffices and never pins afterEach cleanup.
|
||||||
* @param path - the fixture tree to remove.
|
* @param path - the fixture tree to remove.
|
||||||
*/
|
*/
|
||||||
export function removeFixtureSafely(path: string): void {
|
export function removeFixtureSafely(path: string): void {
|
||||||
unlinkFixtureLinks(path)
|
unlinkFixtureLinks(path)
|
||||||
rmSync(path, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 })
|
rmSync(path, { recursive: true, force: true, maxRetries: 50, retryDelay: 200 })
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user