test(windows): preserve E2B cleanup coverage

This commit is contained in:
Tianyi Cui
2026-08-09 05:16:25 +08:00
parent 2ce8d88a4d
commit dd2082c82c
4 changed files with 19 additions and 4 deletions
@@ -910,6 +910,21 @@ describe('E2B subprocess terminal service', () => {
})
it('contains a failed automatic terminal release until service disposal retries it', async () => {
const { fiber, fake } = await service()
fake.clearOnTerm = false
fake.clearOnKill = false
const terminal = await (fiber.ctx).subprocess.spawnTerminal(spec({ graceMs: 1 }))
fake.handle.succeed(0)
await terminal.done
await new Promise(resolve => setTimeout(resolve, 10))
expect(fake.commands).toContain('kill -KILL -- -123')
fake.groups = []
await fiber.dispose()
await expect(terminal.terminate()).resolves.toBeUndefined()
})
it('contains an immediate automatic terminal release rejection before disposal retries it', async () => {
const { fiber, fake } = await service()
fake.groups = []
const terminal = await (fiber.ctx).subprocess.spawnTerminal(spec())