gemini-cli PR fixes flaky test by mocking realpathSync in orphan PTY slave fd case

AbbasFullstack · ghdev · 2026-10-29

PR #30018 in google-gemini/gemini-cli fixes a flaky test: shellExecutionService.test.ts mocked statSync/fstatSync/closeSync from node:fs but not realpathSync, so closeOrphanSlaveFd hit the real implementation. On machines where /dev/ttys001 exists (any Mac with a second terminal open), the test took the /dev/fd comparison path instead of the intended rdev-only path.

The fix adds a hoisted mockRealpathSync wired into the existing mock, and makes the darwin test throw ENOENT so the rdev-only branch runs deterministically on every host. No production code changes; all 85 tests pass.

Original post →

More from coding & agent

coding & agent channel →