Skip to content

Commit

Permalink
termtest: Don't fail on 'file already closed' (#303)
Browse files Browse the repository at this point in the history
There's a race on closing the file and stopping to read from it.
It's not a failure to have a closed pty here instead of EOF.

[skip changelog]: not user facing
  • Loading branch information
abhinav authored Jul 24, 2024
1 parent 5fb36e4 commit 99bfac1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/termtest/with_term.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ loop:
}
}
if err != nil {
if !errors.Is(err, io.EOF) {
if !errors.Is(err, io.EOF) && !errors.Is(err, os.ErrClosed) {
m.logf("read error: %v", err)
}
break loop
Expand Down

0 comments on commit 99bfac1

Please sign in to comment.