Skip to content

Commit cbdd134

Browse files
authored
Merge pull request #186 from facebookincubator/fix_teststeps_leaks
Minor fix for sshcmd and terminalexpect plugins
2 parents 11cf03a + 330a5b0 commit cbdd134

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

plugins/teststeps/sshcmd/sshcmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func (ts *SSHCmd) Run(cancel, pause <-chan struct{}, ch test.TestStepChannels, p
195195
session.Stdout, session.Stderr = &stdout, &stderr
196196
cmd := shellquote.Join(append([]string{executable}, args...)...)
197197
log.Printf("Running remote SSH command on %s: '%v'", addr, cmd)
198-
errCh := make(chan error)
198+
errCh := make(chan error, 1)
199199
go func() {
200200
innerErr := session.Run(cmd)
201201
errCh <- innerErr

plugins/teststeps/terminalexpect/terminalexpect.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ func (ts *TerminalExpect) Run(cancel, pause <-chan struct{}, ch test.TestStepCha
7070
errCh := make(chan error)
7171
go func() {
7272
errCh <- hook.Run()
73+
if closeErr := hook.Close(); closeErr != nil {
74+
log.Errorf("Failed to close hook, err: %v", closeErr)
75+
}
7376
}()
7477
select {
7578
case err := <-errCh:

0 commit comments

Comments
 (0)