diff --git a/plugin/grpc/proxy.go b/plugin/grpc/proxy.go index 9a96e9504..f8322680b 100644 --- a/plugin/grpc/proxy.go +++ b/plugin/grpc/proxy.go @@ -37,7 +37,7 @@ func newProxy(addr string, tlsConfig *tls.Config) (*Proxy, error) { p.dialOpts = append(p.dialOpts, grpc.WithTransportCredentials(insecure.NewCredentials())) } - conn, err := grpc.Dial(p.addr, p.dialOpts...) + conn, err := grpc.NewClient(p.addr, p.dialOpts...) if err != nil { return nil, err } diff --git a/test/grpc_test.go b/test/grpc_test.go index 37504c930..157b4e397 100644 --- a/test/grpc_test.go +++ b/test/grpc_test.go @@ -3,7 +3,6 @@ package test import ( "context" "testing" - "time" "github.com/coredns/coredns/pb" @@ -23,9 +22,7 @@ func TestGrpc(t *testing.T) { } defer g.Stop() - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) - defer cancel() - conn, err := grpc.DialContext(ctx, tcp, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock()) + conn, err := grpc.NewClient(tcp, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock()) if err != nil { t.Fatalf("Expected no error but got: %s", err) }