From a5d5f5b797c62219b41da7bb04c481d2e4fc8b67 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Tue, 19 May 2026 16:26:01 +0300 Subject: [PATCH] chore(pty/ptytest): log scanner errors during shutdown (#25485) --- pty/ptytest/ptytest.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pty/ptytest/ptytest.go b/pty/ptytest/ptytest.go index 5885434511..7aaac5b2dc 100644 --- a/pty/ptytest/ptytest.go +++ b/pty/ptytest/ptytest.go @@ -132,6 +132,10 @@ func newExpecter(t *testing.T, r io.Reader, name string) outExpecter { for s.Scan() { ex.logf("%q", stripansi.Strip(s.Text())) } + // Surface non-EOF scanner errors; otherwise they're invisible. + if err := s.Err(); err != nil { + ex.logf("log scanner stopped: %v", err) + } }() return ex