Skip to content

Commit bba2e4f

Browse files
authored
Merge pull request #842 from yussufsh/test
Fix for Integration Test failure
2 parents 36c3155 + 3828793 commit bba2e4f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tests/remote/pi_resources.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"errors"
2222
"fmt"
2323
"os"
24+
"strings"
2425
"time"
2526

2627
"github.com/IBM-Cloud/power-go-client/clients/instance"
@@ -271,20 +272,24 @@ func waitForInstanceHealth(insID string, ic *instance.IBMPIInstanceClient) (*mod
271272
// Wait till SSH test is complete.
272273
func waitForInstanceSSH(publicIP string) error {
273274
err := wait.PollUntilContextTimeout(context.Background(), 20*time.Second, 30*time.Minute, true, func(context.Context) (bool, error) {
274-
var err error
275275
outp, err := runRemoteCommand(publicIP, "hostname")
276-
klog.Infof("out: %s err: %v", outp, err)
276+
klog.Infof("out: %s, err: %v", outp, err)
277+
if strings.Contains(outp, "Connection timed out") {
278+
klog.Warningf("Ignoring SSH Connection timed out error")
279+
return false, nil
280+
}
277281
if err != nil {
282+
klog.Warningf("Unexpected SSH error: %v.", err)
278283
return false, err
279284
}
280285
return true, nil
281286
})
282287

283288
if err != nil {
284-
return fmt.Errorf("failed to get ssh connection: %v", err)
289+
return fmt.Errorf("failed to get SSH connection: %v", err)
285290
}
286291

287-
return err
292+
return nil
288293
}
289294

290295
// Delete the VM and SSH key.

0 commit comments

Comments
 (0)