fix(runtime): close portable backend boundary gaps
This commit is contained in:
@@ -59,9 +59,10 @@ export class LocalSubprocessService extends SubprocessService {
|
||||
pending.push(handle.done.catch(() => {}).then(() => handle.waitForExit()))
|
||||
}
|
||||
for (const terminal of this.terminals) {
|
||||
pending.push(terminal.terminate().then(() => { this.terminals.delete(terminal) }))
|
||||
pending.push(terminal.terminate())
|
||||
}
|
||||
this.live.clear()
|
||||
this.terminals.clear()
|
||||
const outcomes = [
|
||||
...await Promise.allSettled(pending),
|
||||
...await Promise.allSettled([rm(this.runtimeRoot, { recursive: true, force: true })]),
|
||||
|
||||
@@ -113,7 +113,7 @@ describe('LocalSubprocessService', () => {
|
||||
expect(terminals.size).toBe(0)
|
||||
})
|
||||
|
||||
it('waits for every terminal cleanup, removes runtime state, and retains rejections', async () => {
|
||||
it('waits for every terminal cleanup and clears single-shot teardown ownership', async () => {
|
||||
const ctx = new Context()
|
||||
const fiber = await ctx.plugin(LocalSubprocessService)
|
||||
const service = ctx.subprocess
|
||||
@@ -154,7 +154,7 @@ describe('LocalSubprocessService', () => {
|
||||
expect(disposed).toBe(false)
|
||||
finishCleanup()
|
||||
await disposing
|
||||
expect(terminals).toEqual(new Set([failedTerminal, secondFailedTerminal]))
|
||||
expect(terminals.size).toBe(0)
|
||||
await expect(stat(runtimeRoot)).rejects.toMatchObject({ code: 'ENOENT' })
|
||||
expect(disposalErrors).toHaveLength(1)
|
||||
expect(disposalErrors[0]).toMatchObject({
|
||||
|
||||
Reference in New Issue
Block a user