Skip to content

Commit 2cb20d6

Browse files
authored
Merge pull request #849 from anshuman-agarwala/integration-test-fix
fixed bug in integration test
2 parents 1197d74 + bdb69f4 commit 2cb20d6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/it/utils.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@ package it
1818

1919
import (
2020
"context"
21+
"errors"
2122
"fmt"
2223
"net"
2324
"os"
25+
"syscall"
2426
"time"
2527

2628
"github.com/container-storage-interface/spec/lib/go/csi"
2729
"google.golang.org/grpc"
2830
"google.golang.org/grpc/credentials/insecure"
2931
"google.golang.org/grpc/resolver"
30-
3132
"k8s.io/apimachinery/pkg/util/wait"
3233
"k8s.io/klog/v2"
3334

@@ -123,7 +124,10 @@ func newCSIClient() (*CSIClient, error) {
123124
var conn net.Conn
124125
err = wait.PollUntilContextTimeout(context.Background(), 10*time.Second, 3*time.Minute, true, func(context.Context) (bool, error) {
125126
conn, err = net.Dial(scheme, addr)
126-
if err != nil {
127+
if errors.Is(err, syscall.ECONNREFUSED) {
128+
klog.Info("Endpoint is not available yet")
129+
return false, nil
130+
} else if err != nil {
127131
klog.Warningf("Client failed to dial endpoint %v", endpoint)
128132
return false, err
129133
}

0 commit comments

Comments
 (0)