Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
"slogtest",
"sourcemapped",
"Srcs",
"stdbuf",
"stretchr",
"STTY",
"stuntest",
Expand Down
9 changes: 7 additions & 2 deletions pty/ptytest/ptytest.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,13 @@ func create(t *testing.T, ptty pty.PTY, name string) *PTY {
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
defer cancel()

_ = out.Close()
_ = ptty.Close()
Comment thread
mafredri marked this conversation as resolved.
// Close pty only so that the copy goroutine can consume the
// remainder of it's buffer and then exit.
err := ptty.Close()
// Pty may already be closed, so don't fail the test, but log
// the error in case it's significant.
logf(t, name, "closed pty: %v", err)

select {
case <-ctx.Done():
fatalf(t, name, "cleanup", "copy did not close in time")
Expand Down