fix(plugin): bound kubernetes sandbox execution

This commit is contained in:
Dotta
2026-05-12 12:34:08 -05:00
committed by Chris Farhood
parent e691d30d12
commit 39d81c732c
5 changed files with 72 additions and 25 deletions
@@ -213,4 +213,16 @@ describe("waitForSandboxReady", () => {
}),
).rejects.toThrow(/failed.*OOMKilled/i);
});
it("fails fast when Sandbox starts terminating before it is ready", async () => {
const get = vi.fn().mockResolvedValue(makeCr("Terminating"));
const clients = { custom: { getNamespacedCustomObject: get } };
await expect(
waitForSandboxReady(clients as never, "ns", "pc-abc", {
timeoutMs: 5000,
pollMs: 10,
}),
).rejects.toThrow(/terminating before it became ready/i);
expect(get).toHaveBeenCalledTimes(1);
});
});