fix(runtime): close measured portability defects

This commit is contained in:
Tianyi Cui
2026-07-29 20:20:51 +08:00
parent 124fc6a611
commit 674d23118b
6 changed files with 73 additions and 26 deletions

View File

@@ -237,7 +237,7 @@ export class LocalPtySession implements PtyBackendSession {
}
this.activeDeadlineTimer = setTimeout(() => {
if (this.active === operation) {
this.settleActive('timeout', this.activeWrite?.operation === operation)
this.settleActive('timeout', this.activeWrite?.operation === operation || this.interrupting === operation)
}
}, this.config.timeoutMs)
void this.beginSend(operation, request)

View File

@@ -365,11 +365,11 @@ describe('LocalPtySession readiness and output', () => {
expect(operation.cancel()).toBe(true)
terminal.emitData('\x1b]133;D;130\x07dsh> ')
await vi.advanceTimersByTimeAsync(10)
await vi.advanceTimersByTimeAsync(100)
expect((await operation.done).waitReason).toBe('timeout')
expect(() => session.startSend({ text: 'successor', submit: true })).toThrow('active send')
signalGate.resolve(undefined)
await vi.advanceTimersByTimeAsync(10)
await operation.done
await vi.advanceTimersByTimeAsync(0)
expect(inspector.groups).toContainEqual([456, 'SIGINT'])
expect(inspector.groups).not.toContainEqual([789, 'SIGINT'])
})