diff --git a/test/fixtures/supervisor-runner.ts b/test/fixtures/supervisor-runner.ts index 6a98979af..79714a0dc 100644 --- a/test/fixtures/supervisor-runner.ts +++ b/test/fixtures/supervisor-runner.ts @@ -24,15 +24,18 @@ import type { BrainEngine } from '../../src/core/engine.ts'; // Mock engine: healthCheck() calls engine.executeRaw; return empty rows so // the query path exercises without needing Postgres. // -// #1849: start() now acquires the queue-scoped DB singleton lock via -// tryAcquireDbLock, which uses the postgres `sql` tagged-template escape hatch. -// The stub returns a single row from every call so acquire succeeds (length 1 -// → acquired) and refresh/release are no-ops. Each spawned runner is a fresh -// process, so there's no cross-test lock state to clean up. +// #1849: start() acquires the queue-scoped DB singleton lock via +// tryAcquireDbLock. #2750 routed the acquire upsert through engine.executeRaw +// (signal-boundable) and release through engine.executeRawDirect, so the +// stub returns a single row from the lock upsert (length 1 → acquired) and +// empty rows everywhere else. Each spawned runner is a fresh process, so +// there's no cross-test lock state to clean up. const sqlStub = (..._args: unknown[]) => Promise.resolve([{ id: 'supervisor-lock' }]); const mockEngine: Partial = { kind: 'postgres' as const, - executeRaw: async () => [], + executeRaw: async (query: string) => + query.includes('gbrain_cycle_locks') ? [{ id: 'supervisor-lock' }] : [], + executeRawDirect: async () => [], sql: sqlStub, } as unknown as BrainEngine;