test(firmware): retain unverified workers before further launches

This commit is contained in:
N0zoM1z0
2026-10-11 02:38:48 +08:00
parent 1ae4bec45b
commit c2e2ed9aa2
@@ -324,7 +324,7 @@ it("cancels a waiting request promptly while keeping later launches behind the a
await assertFirmwareCleanup(fixture.launches); await assertFirmwareCleanup(fixture.launches);
}); });
it("retains an uncertain workspace and lets the next operation create a new root", async () => { it("retains an uncertain worker's workspace and blocks later launches", async () => {
const fixture = await firmwareFixture("cleanup-failure"); const fixture = await firmwareFixture("cleanup-failure");
const first = await fixture.service.execute("inspect_firmware_regions", { const first = await fixture.service.execute("inspect_firmware_regions", {
path: fixture.path, path: fixture.path,
@@ -335,18 +335,15 @@ it("retains an uncertain workspace and lets the next operation create a new root
}); });
const workspace = fixture.launches[0]?.cwd; const workspace = fixture.launches[0]?.cwd;
expect(workspace).toBeDefined(); expect(workspace).toBeDefined();
if (workspace === undefined) return; if (workspace === undefined) throw new Error("Expected retained workspace");
await access(workspace); await access(workspace);
const acquiredLaunches = [...fixture.launches];
const next = await fixture.service.execute("inspect_firmware_regions", { const next = await fixture.service.execute("inspect_firmware_regions", {
path: fixture.path, path: fixture.path,
}); });
expect(next).toMatchObject({ ok: false, error: { cleanupIncomplete: true } }); expect(next).toMatchObject({ ok: false, error: { cleanupIncomplete: true } });
expect(fixture.launches).toHaveLength(2); expect(fixture.launches).toEqual(acquiredLaunches);
const nextWorkspace = fixture.launches[1]?.cwd;
expect(nextWorkspace).toBeDefined();
expect(nextWorkspace).not.toBe(workspace);
await access(workspace); await access(workspace);
if (nextWorkspace !== undefined) await access(nextWorkspace);
}); });
it("accepts another build on the verified release line and reports it", async () => { it("accepts another build on the verified release line and reports it", async () => {