fix: harden queue lifecycle and publish gate
- Preserve phase results on partial retry and keep interrupted phase context after restart. - Avoid webhook bookkeeping crashes when retention deletes stale jobs. - Add deeper unit, integration, and e2e coverage around queue seams. - Require verify job to pass before publish runs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -23,4 +23,22 @@ describe('WorkerPool', () => {
|
||||
|
||||
expect(maxActive).toBe(2);
|
||||
});
|
||||
|
||||
it('times out while draining slow tasks', async () => {
|
||||
const pool = new WorkerPool(1);
|
||||
let release!: () => void;
|
||||
const blocked = new Promise<void>((resolve) => {
|
||||
release = resolve;
|
||||
});
|
||||
|
||||
void pool.run(async () => {
|
||||
await blocked;
|
||||
});
|
||||
|
||||
await waitFor(() => pool.activeCount === 1);
|
||||
await expect(pool.drain(10)).rejects.toThrow(/Timed out waiting for workers to drain/);
|
||||
|
||||
release();
|
||||
await pool.drain();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user