Skip to content

test: isolate bash PTY tests from the host ~/.bashrc - #3173

Merged
max-sixty merged 1 commit into
mainfrom
fix-flaky-source-error-pty
Jun 23, 2026
Merged

test: isolate bash PTY tests from the host ~/.bashrc#3173
max-sixty merged 1 commit into
mainfrom
fix-flaky-source-error-pty

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Problem

The bash arm of exec_in_pty_shell (tests/integration_tests/shell_wrapper.rs) was the only shell arm without rc-file isolation. zsh sets ZDOTDIR=/dev/null + --no-rcs, nu sets --no-config-file, and the sibling exec_bash_truly_interactive already passes --norc --noprofile — but the bash arm did not. Because the PTY harness sets HOME to the real home, interactive bash -i sourced the host's ~/.bashrc, leaking host-specific startup output into the captured PTY snapshots.

Fix

Add --norc --noprofile to the bash arm, mirroring the zsh/nu arms and exec_bash_truly_interactive. It's orthogonal to job control (that's driven by -i), so the job-control leak-detection tests (test_*_no_job_control*) still exercise the interactive path; it's a no-op for the non-interactive bash -c path used by test_source_flag_forwards_errors.

Follow-up to #3161 / #3165, which fixed the macOS PTY-test hang and isolated several other tests but left this arm untouched.

Tests

All 88 shell_wrapper tests pass, plus the full pre-merge gate (4102 tests, all lints and doctests).

This was written by Claude Code on behalf of max

The bash arm of `exec_in_pty_shell` was the only shell arm without rc-file
isolation: zsh sets ZDOTDIR=/dev/null + --no-rcs, nu sets --no-config-file,
and the sibling `exec_bash_truly_interactive` already passes --norc
--noprofile. Because the PTY harness sets HOME to the real home, interactive
`bash -i` sourced the host's ~/.bashrc, leaking host-specific startup output
into the captured snapshots.

Add --norc --noprofile to the bash arm, mirroring the zsh/nu arms and
`exec_bash_truly_interactive`. It's orthogonal to job control (driven by -i),
so the job-control leak-detection tests still exercise the interactive path,
and it's a no-op for the non-interactive `bash -c` path used by
test_source_flag_forwards_errors.

Follow-up to #3161 / #3165, which fixed the macOS PTY-test hang and isolated
several other tests but left this arm untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@max-sixty
max-sixty merged commit 2c0a701 into main Jun 23, 2026
37 checks passed
@max-sixty
max-sixty deleted the fix-flaky-source-error-pty branch June 23, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants