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 <eallam@icloud.com>
This commit is contained in:
Devin AI
2026-04-16 11:10:07 +00:00
parent 439c4d7688
commit a21061facb
@@ -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({