Skip to content

The open-source app everyone uses to manage agents at work

test(SAG-4328): de-flake checkout-lock race in orphan-recovery test (#8315)

dmndbrp-oss0186e66c7ca7
diff --git a/server/src/__tests__/heartbeat-process-recovery.test.ts b/server/src/__tests__/heartbeat-process-recovery.test.ts
index 136799732b..177e207287 100644
--- a/server/src/__tests__/heartbeat-process-recovery.test.ts
+++ b/server/src/__tests__/heartbeat-process-recovery.test.ts
@@ -1024,7 +1024,9 @@ describeEmbeddedPostgres("heartbeat orphaned process recovery", () => {
.where(eq(issues.id, issueId))
.then((rows) => {
const row = rows[0] ?? null;
- return row?.executionRunId === retryRun?.id ? row : null;
+ return row?.executionRunId === retryRun?.id && row?.checkoutRunId === null
+ ? row
+ : null;
})
);
expect(issue?.executionRunId).toBe(retryRun?.id ?? null);