mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: Add ps.Kill/Wait to test cleanup in ptytest.Start (#3387)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user