fix(cron): start isolated timeout after execution begins

This commit is contained in:
Peter Steinberger
2026-04-27 08:15:45 +01:00
parent 45778a840d
commit 729147dcb5
12 changed files with 146 additions and 31 deletions

View File

@@ -133,9 +133,10 @@ export function createDefaultIsolatedRunner(): CronServiceDeps["runIsolatedAgent
export function createAbortAwareIsolatedRunner(summary = "late") {
let observedAbortSignal: AbortSignal | undefined;
const started = createDeferred<void>();
const runIsolatedAgentJob = vi.fn(async ({ abortSignal }) => {
const runIsolatedAgentJob = vi.fn(async ({ abortSignal, onExecutionStarted }) => {
observedAbortSignal = abortSignal;
started.resolve();
onExecutionStarted?.();
await new Promise<void>((resolve) => {
if (!abortSignal) {
return;