Merge branch 'codex/work-folders-remote-recovery-refresh' into codex/work-folders-session-compat-refresh

* codex/work-folders-remote-recovery-refresh:
  test(daytona): retain explicit destroy failure coverage
  test(daytona): preserve reusable work after stop failure
This commit is contained in:
Dotta committed 2026-09-11 17:22:09 -05:00
commit d3a3a55669
1 file changed
+3 -3
@@ -1330,16 +1330,16 @@ describe("Daytona sandbox provider plugin", () => {
expect(sandbox.stop).toHaveBeenCalled();
});
it("does not acknowledge termination when both provider stop and delete fail", async () => {
it("does not acknowledge termination or delete a reusable sandbox when stopping fails", async () => {
process.env.DAYTONA_API_KEY = "host-key";
const sandbox = createMockSandbox({ id: "sandbox-failed-stop", state: "started" });
sandbox.stop.mockRejectedValueOnce(new Error("stop failed"));
sandbox.delete.mockRejectedValueOnce(new Error("delete failed"));
mockGet.mockResolvedValue(sandbox);
await expect(plugin.definition.onEnvironmentReleaseLease?.({
driverKey: "daytona", companyId: "company-1", environmentId: "env-1",
providerLeaseId: sandbox.id, config: { reuseLease: true },
})).rejects.toThrow("delete failed");
})).rejects.toThrow("stop failed");
expect(sandbox.delete).not.toHaveBeenCalled();
});
it("stops reusable leases and deletes ephemeral leases on release", async () => {