From 5bd2cd0abed82ecd914c2dd757958b33b3378cfc Mon Sep 17 00:00:00 2001 From: wl-chen Date: Fri, 6 May 2022 18:12:30 +0800 Subject: [PATCH] fix(test): ssh poll cant support timeout with err --- pkg/util/ssh/ssh.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/util/ssh/ssh.go b/pkg/util/ssh/ssh.go index 2b973e465..699263c8f 100644 --- a/pkg/util/ssh/ssh.go +++ b/pkg/util/ssh/ssh.go @@ -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 }) }