Skip to content
Merged
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
fix: Add ps.Kill/Wait to test cleanup in ptytest.Start
  • Loading branch information
mafredri committed Aug 5, 2022
commit 443b222025977485deb6a4fe6a042bda46a523c5
4 changes: 4 additions & 0 deletions pty/ptytest/ptytest.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ func Start(t *testing.T, cmd *exec.Cmd) (*PTY, pty.Process) {

ptty, ps, err := pty.Start(cmd)
require.NoError(t, err)
t.Cleanup(func() {
_ = ps.Kill()
_ = ps.Wait()
})
return create(t, ptty, cmd.Args[0]), ps
}

Expand Down