From e958ae5d85b2c549fa8d4b5cebf464795a904feb Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 8 Sep 2026 01:41:16 -0700 Subject: [PATCH] test(orchestration): give the stopping-worker task guard a Run #19542 tightened createTask so a Task without a Run throws instead of falling back to the legacy Run, and migrated every existing test to pass `runId: 'run_legacy_local'` (254 such lines) with writer-run-required.test.ts pinning the throw. #19551 added this file 16 seconds later, validated against a main that predated #19542, with two bare createTask calls. Each PR was green alone; together shard 3/8 fails all 7 cases here with "Run is required". The stale side is this test, not createTask: re-loosening the writer would undo a deliberate, pinned invariant to make a newer test pass. Pass the legacy Run at both sites, matching the shape #19542 established. Swept the rest: with this change, every test under src/main/runtime/ orchestration and src/main/runtime/rpc/methods/orchestration passes (194 files, 1611 tests); the remaining bare createTask calls are either the intentional pin in writer-run-required.test.ts or RPC-harness tests whose db is bound to a run by the harness. --- .../orchestration/db-stopping-worker-task-guard.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/runtime/orchestration/db-stopping-worker-task-guard.test.ts b/src/main/runtime/orchestration/db-stopping-worker-task-guard.test.ts index 21816c4492a..a747ae07a51 100644 --- a/src/main/runtime/orchestration/db-stopping-worker-task-guard.test.ts +++ b/src/main/runtime/orchestration/db-stopping-worker-task-guard.test.ts @@ -12,7 +12,7 @@ describe('a Task whose supervised worker is stopping', () => { afterEach(() => db.close()) function localWorker() { - const task = db.createTask({ spec: 'local work' }) + const task = db.createTask({ runId: 'run_legacy_local', spec: 'local work' }) const { dispatch } = db.createStartingWorkerDispatch({ taskId: task.id, startOptions: {}, @@ -59,7 +59,7 @@ describe('a Task whose supervised worker is stopping', () => { }) it('control: still accepts dispatched for an active Dispatch with no supervised worker', () => { - const task = db.createTask({ spec: 'unsupervised work' }) + const task = db.createTask({ runId: 'run_legacy_local', spec: 'unsupervised work' }) createRootDispatch(db, task.id, 'term_worker') expect(db.updateTaskStatus(task.id, 'dispatched')?.status).toBe('dispatched')