fix: harden embedded Pi lifecycle recovery
This commit is contained in:
@@ -170,15 +170,25 @@ test("maintenance endpoints report marker-derived state after post-rename and po
|
||||
|
||||
const activated = await app.inject({ method: "POST", url: "/internal/maintenance/activate" });
|
||||
expect(activated.statusCode).toBe(500);
|
||||
expect(activated.json()).toMatchObject({ active: true, admissions: 0 });
|
||||
expect(activated.json()).toMatchObject({
|
||||
active: true,
|
||||
admissions: 0,
|
||||
recoveryRequired: true,
|
||||
code: "maintenance_durability_failed",
|
||||
});
|
||||
|
||||
failSync = false;
|
||||
expect((await app.inject({ method: "GET", url: "/internal/maintenance/status" })).json())
|
||||
.toEqual({ active: true, admissions: 0 });
|
||||
.toEqual({ active: true, admissions: 0, recoveryRequired: true });
|
||||
failSync = true;
|
||||
const deactivated = await app.inject({ method: "POST", url: "/internal/maintenance/deactivate" });
|
||||
expect(deactivated.statusCode).toBe(500);
|
||||
expect(deactivated.json()).toMatchObject({ active: false, admissions: 0 });
|
||||
expect(deactivated.json()).toMatchObject({
|
||||
active: true,
|
||||
admissions: 0,
|
||||
recoveryRequired: true,
|
||||
code: "maintenance_durability_failed",
|
||||
});
|
||||
} finally {
|
||||
rmSync(dir, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user