test: cover concurrent registry and close cleanup
This commit is contained in:
@@ -189,6 +189,25 @@ test("Pi receives the leased workspace runtime config and releases it on direct
|
||||
expect(release).toHaveBeenCalledOnce();
|
||||
});
|
||||
|
||||
test("a close-only child event releases its temporary Pi agent snapshot", () => {
|
||||
const child = recordingChild();
|
||||
let snapshotDir: string | undefined;
|
||||
const mgr = new PiProcessManager(loadConfig({}), {
|
||||
spawnFn: (_command, _args, options) => {
|
||||
snapshotDir = options.env.PI_CODING_AGENT_DIR;
|
||||
return child as any;
|
||||
},
|
||||
});
|
||||
|
||||
mgr.createFor("close-only-snapshot", {});
|
||||
expect(snapshotDir).toBeTruthy();
|
||||
expect(existsSync(snapshotDir!)).toBe(true);
|
||||
|
||||
child.emit("close", 0);
|
||||
expect(existsSync(snapshotDir!)).toBe(false);
|
||||
mgr.teardown("close-only-snapshot");
|
||||
});
|
||||
|
||||
test.each([
|
||||
["new", "auth.json", '{"deepseek":{"key":"!runtime-auth-command runtime-secret /private/runtime-auth"}}\n'],
|
||||
["new", "models.json", '{"providers":{"local-qwen":{"headers":["!runtime-model-command runtime-secret /private/runtime-model"]}}}\n'],
|
||||
|
||||
Reference in New Issue
Block a user