fix: retain expired backup cleanup after listing failures

This commit is contained in:
Dotta committed 2026-10-30 18:44:34 -05:00
1 parent 7e33906d14
commit 4c4e4a469c
4 files changed
+47 -7

No files matched your search

@@ -5103,7 +5103,10 @@ describe("retained native cleanup activation", () => {
}
const outcome = await pendingOutcome;
if (mode === "legacy_busy_copy") {
expect(maintenanceReleased).toHaveBeenCalledExactlyOnceWith({ companyId: run.companyId, runId: run.id });
expect(maintenanceReleased).toHaveBeenCalledExactlyOnceWith(
{ companyId: run.companyId, runId: run.id },
{ companyId: run.companyId, runId: run.id },
);
unsubscribeMaintenance?.();
}
if (canonicalSource) {
@@ -6425,7 +6428,10 @@ describe("native startup cancellation fence", () => {
})).rejects.toThrow("native_cancellation_pending_recovery");
expect(cancel).toHaveBeenCalledOnce();
expect(submit).not.toHaveBeenCalled();
expect(released).toHaveBeenCalledWith({ companyId: execution.binding.companyId, agentId: execution.binding.agentId });
expect(released).toHaveBeenCalledWith(
{ companyId: execution.binding.companyId, agentId: execution.binding.agentId },
{ companyId: execution.binding.companyId, runId: execution.binding.runId, issueId: execution.binding.issueId },
);
} finally { unsubscribe(); }
});
});
@@ -9872,9 +9878,10 @@ describe("native warm session supervision", () => {
);
expect(released).not.toHaveBeenCalled();
releaseClose();
await vi.waitFor(() => expect(released).toHaveBeenCalledExactlyOnceWith({
companyId: base.binding.companyId, agentId: base.binding.agentId,
}));
await vi.waitFor(() => expect(released).toHaveBeenCalledExactlyOnceWith(
{ companyId: base.binding.companyId, agentId: base.binding.agentId },
{ companyId: base.binding.companyId, runId: base.binding.runId, issueId: base.binding.issueId },
));
} finally { releaseClose(); unsubscribe(); }
});
@@ -12453,7 +12460,10 @@ describe("runnerd provider runtime wiring", () => {
releaseEnvironment();
releaseAssigned();
const result = await preparation;
expect(released).toHaveBeenCalledExactlyOnceWith({ companyId: execution.binding.companyId, agentId: execution.binding.agentId });
expect(released).toHaveBeenCalledExactlyOnceWith(
{ companyId: execution.binding.companyId, agentId: execution.binding.agentId },
{ companyId: execution.binding.companyId, runId: execution.binding.runId, issueId: execution.binding.issueId },
);
if (failure !== "success") {
expect(result).toMatchObject({ error: { message: failure === "assigned" ? "assigned failed" : "environment failed" } });
expect(state.createBackend).not.toHaveBeenCalled();