mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-27 07:01:02 +03:00
fix(skills/tests): cleanupWorkspace терпимо переживает EBUSY от 1cv8
После платформенных тестов (db-create/db-load-xml/db-update) Windows держит файловые хэндлы 1cv8 ещё несколько сотен миллисекунд. rmSync без ретраев падал EBUSY на Roles/.../Rights.xml, и uncaught-ошибка в finally рушила весь node-процесс — теряли результат теста. Теперь rmSync с maxRetries: 10, retryDelay: 200 (≈2с буфер) и try/catch вокруг — в худшем случае warning + лишняя tmp-папка вместо краша. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
ffb0ee740d
commit
41c4b6b1f7
@@ -196,8 +196,14 @@ function createWorkspace(fixturePath, readOnly) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cleanupWorkspace(ws) {
|
function cleanupWorkspace(ws) {
|
||||||
if (!ws.readOnly) {
|
if (ws.readOnly) return;
|
||||||
rmSync(ws.path, { recursive: true, force: true });
|
// On Windows, file handles from db-update (1cv8) may linger briefly after the
|
||||||
|
// process exits — rmSync then throws EBUSY. Retry a few times, then swallow:
|
||||||
|
// a leaked tmp dir is preferable to crashing the entire runner.
|
||||||
|
try {
|
||||||
|
rmSync(ws.path, { recursive: true, force: true, maxRetries: 10, retryDelay: 200 });
|
||||||
|
} catch (e) {
|
||||||
|
console.warn(`Warning: failed to clean workspace ${ws.path}: ${e.message}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user