fix(scripts): do not fail the desktop smoke test on temp cleanup
A writer of the stopped app can still be finishing in the data directory when the smoke test removes its temp root, so rmdir failed with ENOTEMPTY after the test had passed. The temp root is disposable: a failed cleanup now logs a warning.
This commit is contained in:
@@ -71,8 +71,17 @@ function tempRoot(name) {
|
||||
return fs.mkdtempSync(path.join(process.env.RUNNER_TEMP || os.tmpdir(), `waggle-smoke-${name}-`));
|
||||
}
|
||||
|
||||
/**
|
||||
* Best effort: a background writer of the stopped app (a model download into
|
||||
* the data directory) can outlive the stop by a moment. The temp root is
|
||||
* disposable, so a failed cleanup is a warning, not a failed smoke test.
|
||||
*/
|
||||
function removeTree(dir) {
|
||||
fs.rmSync(dir, { recursive: true, force: true, maxRetries: 5, retryDelay: 1000 });
|
||||
try {
|
||||
fs.rmSync(dir, { recursive: true, force: true, maxRetries: 10, retryDelay: 1000 });
|
||||
} catch (error) {
|
||||
log(`Warning: could not remove ${dir}: ${error instanceof Error ? error.message : String(error)}`);
|
||||
}
|
||||
}
|
||||
|
||||
function portIsFree(port) {
|
||||
|
||||
Reference in New Issue
Block a user