From a21061facb7e26ca735b226e6512540807f71ae8 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 16 Apr 2026 11:10:07 +0000 Subject: [PATCH] fix: increase waitpoint test timeouts for PrismaPg adapter overhead With Prisma 7's PrismaPg driver adapter, each query goes through the pg Pool + adapter layer, adding ~5-10ms overhead per query vs the old in-process Rust engine. The continueRunIfUnblocked worker job executes 5+ DB queries, so the previous 200ms window was too tight for CI runners. - Increase setTimeout from 200ms to 1000ms for all completeWaitpoint -> continueRunIfUnblocked wait patterns - Increase idempotencyKeyExpiresAt from 200ms to 60s to prevent expiry during test execution - Increase getSnapshotsSince pre-complete wait from 200ms to 500ms Co-Authored-By: Eric Allam --- .../run-engine/src/engine/tests/waitpoints.test.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal-packages/run-engine/src/engine/tests/waitpoints.test.ts b/internal-packages/run-engine/src/engine/tests/waitpoints.test.ts index 9937314d7..b69aaf84f 100644 --- a/internal-packages/run-engine/src/engine/tests/waitpoints.test.ts +++ b/internal-packages/run-engine/src/engine/tests/waitpoints.test.ts @@ -379,7 +379,7 @@ describe("RunEngine Waitpoints", () => { id: result.waitpoint.id, }); - await setTimeout(200); + await setTimeout(1_000); assertNonNullable(event); const notificationEvent = event as EventBusEventArgs<"workerNotification">[0]; @@ -936,7 +936,7 @@ describe("RunEngine Waitpoints", () => { id: result.waitpoint.id, }); - await setTimeout(200); + await setTimeout(1_000); const executionData2 = await engine.getRunExecutionData({ runId: run.id }); expect(executionData2?.snapshot.executionStatus).toBe("EXECUTING"); @@ -1050,7 +1050,7 @@ describe("RunEngine Waitpoints", () => { environmentId: authenticatedEnvironment.id, projectId: authenticatedEnvironment.projectId, idempotencyKey, - idempotencyKeyExpiresAt: new Date(Date.now() + 200), + idempotencyKeyExpiresAt: new Date(Date.now() + 60_000), }); expect(result.waitpoint.status).toBe("PENDING"); expect(result.waitpoint.idempotencyKey).toBe(idempotencyKey); @@ -1060,7 +1060,7 @@ describe("RunEngine Waitpoints", () => { environmentId: authenticatedEnvironment.id, projectId: authenticatedEnvironment.projectId, idempotencyKey, - idempotencyKeyExpiresAt: new Date(Date.now() + 200), + idempotencyKeyExpiresAt: new Date(Date.now() + 60_000), }); expect(sameWaitpointResult.waitpoint.id).toBe(result.waitpoint.id); @@ -1096,7 +1096,7 @@ describe("RunEngine Waitpoints", () => { id: result.waitpoint.id, }); - await setTimeout(200); + await setTimeout(1_000); const executionData2 = await engine.getRunExecutionData({ runId: run.id }); expect(executionData2?.snapshot.executionStatus).toBe("EXECUTING"); @@ -1212,9 +1212,9 @@ describe("RunEngine Waitpoints", () => { }); // Wait for the waitpoint to complete and unblock (snapshot 3) - await setTimeout(200); + await setTimeout(500); await engine.completeWaitpoint({ id: waitpoint.id }); - await setTimeout(200); + await setTimeout(1_000); // Get all snapshots for the run const allSnapshots = await prisma.taskRunExecutionSnapshot.findMany({