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() {
|
cleanup() {
|
||||||
rmSync(this.tempDir, { recursive: true, force: true });
|
try {
|
||||||
setWorkspaceRoot(this.previousWorkspaceRoot);
|
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() {
|
reset() {
|
||||||
rmSync(this.tempDir, { recursive: true, force: true });
|
try {
|
||||||
mkdirSync(this.tempDir, { recursive: true });
|
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