Skip to content

Commit

Permalink
fix(test): ssh poll cant support timeout with err (tkestack#1911)
Browse files Browse the repository at this point in the history
  • Loading branch information
wl-chen authored and xdonggao committed Sep 14, 2022
1 parent 8b9b468 commit 1d2e7a6
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 1d2e7a6

Please sign in to comment.