Hint pty allocation failures for macOS ENXIO (#4917)
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -42,6 +42,12 @@ describe('node-pty diagnostic error hints', () => {
|
||||
expect(addNodePtyRecoveryHint(message)).toBe(`${PTY_ALLOCATION_HINT} ${message}`)
|
||||
})
|
||||
|
||||
it('hints when macOS cannot configure a pty master device', () => {
|
||||
const message = 'node-pty: posix_openpt failed: errno (errno 6, Device not configured)'
|
||||
|
||||
expect(addNodePtyRecoveryHint(message)).toBe(`${PTY_ALLOCATION_HINT} ${message}`)
|
||||
})
|
||||
|
||||
it('hints local wrapped spawn errors from pty allocation failures', () => {
|
||||
const message =
|
||||
'Failed to spawn shell "/bin/zsh": node-pty: open_slave failed: EMFILE (errno 24, Too many open files) - slave=\'/dev/ttys003\' (shell: /bin/zsh, cwd: /tmp, arch: arm64, platform: darwin 25.0.0). If this persists, please file an issue.'
|
||||
|
||||
@@ -17,6 +17,7 @@ const PTY_ALLOCATION_STEPS = new Set([
|
||||
])
|
||||
|
||||
const RESOURCE_EXHAUSTION_ERRNOS = new Set([
|
||||
6, // ENXIO on macOS: posix_openpt could not provide a usable pty device
|
||||
11, // EAGAIN on Linux
|
||||
12, // ENOMEM
|
||||
23, // ENFILE on macOS
|
||||
|
||||
Reference in New Issue
Block a user