diff --git a/ssh/client.go b/ssh/client.go index e2a143ee..72b01ab7 100644 --- a/ssh/client.go +++ b/ssh/client.go @@ -42,7 +42,7 @@ func Client(c net.Conn, config *ClientConfig) (*ClientConn, error) { } if err := conn.handshake(); err != nil { conn.Close() - return nil, err + return nil, fmt.Errorf("handshake failed: %v", err) } go conn.mainLoop() return conn, nil diff --git a/ssh/test/test_unix_test.go b/ssh/test/test_unix_test.go index 22a7691d..be0f0eff 100644 --- a/ssh/test/test_unix_test.go +++ b/ssh/test/test_unix_test.go @@ -129,9 +129,9 @@ func (s *server) Dial(config *ssh.ClientConfig) *ssh.ClientConn { func (s *server) Shutdown() { if s.cmd != nil && s.cmd.Process != nil { - if err := s.cmd.Process.Kill(); err != nil { - s.t.Error(err) - } + // don't check for Kill error; if it fails it's most likely + // "os: process already finished", and we don't care about that. + s.cmd.Process.Kill() s.cmd.Wait() } if s.t.Failed() {