Skip to content

Commit

Permalink
fix(test): ssh poll cant support timeout with err (#1911)
Browse files Browse the repository at this point in the history
  • Loading branch information
wl-chen authored May 6, 2022
1 parent 4fc0183 commit a65952d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/util/ssh/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,11 @@ func (s *SSH) newClient() (*ssh.Client, func(), error) {
}
client, err := s.dialer.Dial("tcp", s.addr(), config)
if err != nil {
err = wait.Poll(5*time.Second, time.Duration(s.Retry)*5*time.Second, func() (bool, error) {
wait.Poll(5*time.Second, time.Duration(s.Retry)*5*time.Second, func() (bool, error) {
if client, err = s.dialer.Dial("tcp", s.addr(), config); err != nil {
return false, err
return false, nil
}
err = nil
return true, nil
})
}
Expand Down

0 comments on commit a65952d

Please sign in to comment.