diff --git a/server/src/__tests__/heartbeat-process-recovery.test.ts b/server/src/__tests__/heartbeat-process-recovery.test.ts index 797fa163..723f8455 100644 --- a/server/src/__tests__/heartbeat-process-recovery.test.ts +++ b/server/src/__tests__/heartbeat-process-recovery.test.ts @@ -1425,8 +1425,11 @@ describeEmbeddedPostgres("heartbeat orphaned process recovery", () => { }); expect(recoveryAction?.nextAction).toContain("Repair the source issue workspace link"); - const comments = await db.select().from(issueComments).where(eq(issueComments.issueId, issueId)); - expect(comments.some((comment) => comment.body.includes("workspace failed validation"))).toBe(true); + const validationComment = await waitForValue(async () => { + const rows = await db.select().from(issueComments).where(eq(issueComments.issueId, issueId)); + return rows.find((comment) => comment.body.includes("workspace failed validation")) ?? null; + }); + expect(validationComment).toBeTruthy(); }); it("queues one finish-handoff wake when a successful run leaves in-progress work without a next action", async () => {