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