mirror of https://github.com/coder/coder.git
fix: Add ps.Kill/Wait to test cleanup in `ptytest.Start` (#3387)
This commit is contained in:
parent
fb9fca8bc9
commit
46d64c624a
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue