chore(core): add maxRetries to temp-fs cleanup (#30828)
This commit is contained in:
parent
121a42a417
commit
8c4e8105e2
@ -105,12 +105,30 @@ export class TempFs {
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
rmSync(this.tempDir, { recursive: true, force: true });
|
||||
setWorkspaceRoot(this.previousWorkspaceRoot);
|
||||
try {
|
||||
rmSync(this.tempDir, { recursive: true, force: true, maxRetries: 5 });
|
||||
setWorkspaceRoot(this.previousWorkspaceRoot);
|
||||
} catch (e) {
|
||||
// We are experiencing flakiness in CI related to this cleanup, so log only for now
|
||||
if (process.env.CI) {
|
||||
console.error(`Failed to cleanup temp dir: ${e}`);
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
reset() {
|
||||
rmSync(this.tempDir, { recursive: true, force: true });
|
||||
mkdirSync(this.tempDir, { recursive: true });
|
||||
try {
|
||||
rmSync(this.tempDir, { recursive: true, force: true, maxRetries: 5 });
|
||||
mkdirSync(this.tempDir, { recursive: true });
|
||||
} catch (e) {
|
||||
// We are experiencing flakiness in CI related to this cleanup, so log only for now
|
||||
if (process.env.CI) {
|
||||
console.error(`Failed to cleanup temp dir: ${e}`);
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user