Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2955,6 +2955,9 @@ setTimeout(() => {
console.log(`[startup] recovered task "${task.title}" (${task.id}): in_progress → ${newStatus || 're-armed'}`);
}
processQueue();
// Unconditional and on console (not `log`, which LOG_LEVEL filters): tests that seed
// in_progress rows wait for this line, or this pass re-arms them mid-assertion.
console.log('[startup] in_progress recovery complete');
}, 3000);

// Watchdog: detect tasks stuck in 'in_progress' with no live worker process.
Expand Down
7 changes: 7 additions & 0 deletions test/global-workspace.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ const titles = rows => (rows || []).map(r => r.title).sort();
await api('POST', '/api/projects', { name: 'Gamma', workdir: wdC }); // no tasks at all
check('three projects registered', [typeof A, typeof B], ['string', 'string']);

// server.js re-arms every in_progress task with no live worker ~3 s after boot.
// A fixture created before that pass is flipped to todo under the assertions, so
// wait for the line the pass prints when it is done — not a fixed sleep.
const recovered = await waitFor(() => srvLog.includes('[startup] in_progress recovery complete'),
{ timeoutMs: 30000, intervalMs: 100 });
if (!recovered) { console.error('startup recovery never finished:\n' + srvLog); stop(); process.exit(1); }

const now = Math.floor(Date.now() / 1000);
const mk = (t) => api('POST', '/api/tasks', t);
// Scheduled fixtures are created as in_progress / far-future todo on purpose:
Expand Down
Loading