Skip to content

Commit 46d64c6

Browse files
authored
fix: Add ps.Kill/Wait to test cleanup in ptytest.Start (#3387)
1 parent fb9fca8 commit 46d64c6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pty/ptytest/ptytest.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ func Start(t *testing.T, cmd *exec.Cmd) (*PTY, pty.Process) {
3535

3636
ptty, ps, err := pty.Start(cmd)
3737
require.NoError(t, err)
38+
t.Cleanup(func() {
39+
_ = ps.Kill()
40+
_ = ps.Wait()
41+
})
3842
return create(t, ptty, cmd.Args[0]), ps
3943
}
4044

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy