Runner: instabile Build-Tests behoben

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Sonnet 5.5 committed 2026-09-30 21:53:41 +00:00
1 parent 5b902519a9
commit 71f9243bf2
1 file changed
+6 -4
+6 -4
View File
@@ -210,6 +210,7 @@ export function createJobs({ config, docker, fs: fsOver = {}, git, mem = readMem
const workDir = join(config.workRoot, 'build', run.runId); const workDir = join(config.workRoot, 'build', run.runId);
const deadline = now() + config.buildTimeoutMs; const deadline = now() + config.buildTimeoutMs;
run.state = 'running'; run.state = 'running';
let final;
try { try {
const prep = await prepare(job, { onLine, workDir, id: run.runId, deadline }); const prep = await prepare(job, { onLine, workDir, id: run.runId, deadline });
const d = prep.detected; const d = prep.detected;
@@ -240,16 +241,17 @@ export function createJobs({ config, docker, fs: fsOver = {}, git, mem = readMem
run.result = 'build'; run.result = 'build';
} }
} }
run.state = 'done'; final = 'done';
} catch (e) { } catch (e) {
run.state = 'failed'; final = 'failed';
run.result = undefined; run.result = undefined;
run.error = masker(job)(e?.message || 'Unbekannter Fehler'); run.error = masker(job)(e?.message || 'Unbekannter Fehler');
onLine(run.error); onLine(run.error);
} finally { }
// Endzustand erst nach dem Aufräumen veröffentlichen: wer 'done'/'failed' sieht, sieht ein bereinigtes workDir und finishedAt.
await fs.rm(workDir, { recursive: true, force: true }).catch(() => {}); await fs.rm(workDir, { recursive: true, force: true }).catch(() => {});
run.finishedAt = now(); run.finishedAt = now();
} run.state = final;
} }
function submit(job) { function submit(job) {