feat: release 2.5.1
This commit is contained in:
@@ -67,6 +67,45 @@ function dependencies(
|
||||
}
|
||||
|
||||
describe("server management service", () => {
|
||||
test("waits on deployments together and cancels siblings after a crash", async () => {
|
||||
const started: string[] = [];
|
||||
let siblingCancelled = false;
|
||||
const service = createManagementService(
|
||||
dependencies({
|
||||
listDeployments: async () => [
|
||||
object("Deployment", "healthy", "healthy-uid") as V1Deployment,
|
||||
object("Deployment", "broken", "broken-uid") as V1Deployment,
|
||||
],
|
||||
waitForDeployment: async (_project, name, timeout, execution) => {
|
||||
expect(timeout).toBeGreaterThan(0);
|
||||
started.push(name);
|
||||
if (name === "broken")
|
||||
throw new Error(
|
||||
"Deployment broken rollout failed: CrashLoopBackOff",
|
||||
);
|
||||
await new Promise<void>((resolve) => {
|
||||
if (execution?.signal?.aborted) {
|
||||
siblingCancelled = true;
|
||||
return resolve();
|
||||
}
|
||||
execution?.signal?.addEventListener(
|
||||
"abort",
|
||||
() => {
|
||||
siblingCancelled = true;
|
||||
resolve();
|
||||
},
|
||||
{ once: true },
|
||||
);
|
||||
});
|
||||
},
|
||||
}),
|
||||
);
|
||||
await expect(
|
||||
service.waitForResources(workspace, ["healthy", "broken"], 1000),
|
||||
).rejects.toThrow("Deployment broken rollout failed: CrashLoopBackOff");
|
||||
expect(started).toEqual(["healthy", "broken"]);
|
||||
expect(siblingCancelled).toBe(true);
|
||||
});
|
||||
test("contains no authorization policy and operates on an explicit workspace", async () => {
|
||||
const calls: string[] = [];
|
||||
const service = createManagementService(
|
||||
|
||||
Reference in New Issue
Block a user