mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-10 12:37:55 +01:00
Stabilize source-scoped recovery wake assertion
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
b5e394e843
commit
3bcc66500f
1 file changed
+12
-10
@@ -748,16 +748,18 @@ describeEmbeddedPostgres("heartbeat orphaned process recovery", () => {
|
||||
));
|
||||
expect(recoveryIssues).toHaveLength(0);
|
||||
|
||||
const wakeups = await db
|
||||
.select()
|
||||
.from(agentWakeupRequests)
|
||||
.where(eq(agentWakeupRequests.agentId, input.agentId));
|
||||
const recoveryWakeup = wakeups.find((wakeup) => {
|
||||
const payload = wakeup.payload as Record<string, unknown> | null;
|
||||
return payload?.issueId === input.issueId &&
|
||||
payload?.sourceIssueId === input.issueId &&
|
||||
payload?.recoveryActionId === action.id &&
|
||||
payload?.strandedRunId === input.runId;
|
||||
const recoveryWakeup = await waitForValue(async () => {
|
||||
const wakeups = await db
|
||||
.select()
|
||||
.from(agentWakeupRequests)
|
||||
.where(eq(agentWakeupRequests.agentId, input.agentId));
|
||||
return wakeups.find((wakeup) => {
|
||||
const payload = wakeup.payload as Record<string, unknown> | null;
|
||||
return payload?.issueId === input.issueId &&
|
||||
payload?.sourceIssueId === input.issueId &&
|
||||
payload?.recoveryActionId === action.id &&
|
||||
payload?.strandedRunId === input.runId;
|
||||
}) ?? null;
|
||||
});
|
||||
expect(recoveryWakeup).toMatchObject({
|
||||
companyId: input.companyId,
|
||||
|
||||
Reference in new issue
Block a user