fix: Add ps.Kill/Wait to test cleanup in ptytest.Start (#3387)

This commit is contained in:
Mathias Fredriksson
2022-08-05 13:35:33 +03:00
committed by GitHub
parent fb9fca8bc9
commit 46d64c624a
+4
View File
@@ -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
}