From b86161e0a673d08e8f2ea94822ab8f33af6f5b4a Mon Sep 17 00:00:00 2001 From: Ethan <39577870+ethanndickson@users.noreply.github.com> Date: Wed, 1 Apr 2026 12:31:22 +1100 Subject: [PATCH] test: fix TestServer_X11_EvictionLRU hang on fish shell (#23838) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `TestServer_X11_EvictionLRU` hangs forever when the developer's login shell is `fish`. This is the only test in the repo that breaks on fish, and it meant I couldn't run `make test` or similar without it blocking indefinitely. The test uses `sess.Shell()` to start interactive shell sessions, which causes the SSH server to run the user's login shell directly (`fish -l`). Fish buffers all piped stdin to EOF before executing any of it, so the test's `echo ready-0\n` write never gets processed — fish sits waiting for the pipe to close, and the test sits waiting for the echo response. The fix is a one-line change: `sess.Shell()` → `sess.Start("sh")`. The test is exercising X11 LRU eviction, not shell behavior, so using `sh` explicitly is both correct and shell-agnostic. The DISPLAY environment variable is set identically either way since the x11-req handler runs before `sessionStart`. --- agent/agentssh/x11_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/agentssh/x11_test.go b/agent/agentssh/x11_test.go index 43613ba798..f220a6d519 100644 --- a/agent/agentssh/x11_test.go +++ b/agent/agentssh/x11_test.go @@ -211,7 +211,7 @@ func TestServer_X11_EvictionLRU(t *testing.T) { require.NoError(t, err) stderr, err := sess.StderrPipe() require.NoError(t, err) - require.NoError(t, sess.Shell()) + require.NoError(t, sess.Start("sh")) // The SSH server lazily starts the session. We need to write a command // and read back to ensure the X11 forwarding is started.