mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 21:32:56 -07:00
Refine execution lifecycle facade follow-ups
This commit is contained in:
@@ -133,6 +133,21 @@ describe('ExecutionLifecycleService', () => {
|
||||
expect(result.error?.message).toContain('Operation cancelled by user');
|
||||
});
|
||||
|
||||
it('does not probe OS process state for completed non-process execution IDs', async () => {
|
||||
const handle = ExecutionLifecycleService.createExecution();
|
||||
if (handle.pid === undefined) {
|
||||
throw new Error('Expected execution ID.');
|
||||
}
|
||||
|
||||
ExecutionLifecycleService.completeExecution(handle.pid, { exitCode: 0 });
|
||||
await handle.result;
|
||||
|
||||
const processKillSpy = vi.spyOn(process, 'kill');
|
||||
expect(ExecutionLifecycleService.isActive(handle.pid)).toBe(false);
|
||||
expect(processKillSpy).not.toHaveBeenCalled();
|
||||
processKillSpy.mockRestore();
|
||||
});
|
||||
|
||||
it('manages external executions through registration hooks', async () => {
|
||||
const writeInput = vi.fn();
|
||||
const isActive = vi.fn().mockReturnValue(true);
|
||||
|
||||
Reference in New Issue
Block a user