From 5f400a8a5249bd409284cebf8560aff2bd386ed5 Mon Sep 17 00:00:00 2001 From: Ciara Stacke <18287516+ciarams87@users.noreply.github.com> Date: Fri, 14 Jun 2024 04:41:47 +0100 Subject: [PATCH] Return new default GRPC client instantiation to every request (#3130) --- conformance/utils/grpc/grpc.go | 3 +++ conformance/utils/suite/suite.go | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conformance/utils/grpc/grpc.go b/conformance/utils/grpc/grpc.go index a48109df31..22534421a8 100644 --- a/conformance/utils/grpc/grpc.go +++ b/conformance/utils/grpc/grpc.go @@ -270,6 +270,9 @@ func validateExpectedResponse(t *testing.T, expected ExpectedResponse) { func MakeRequestAndExpectEventuallyConsistentResponse(t *testing.T, c Client, timeoutConfig config.TimeoutConfig, gwAddr string, expected ExpectedResponse) { t.Helper() validateExpectedResponse(t, expected) + if c == nil { + c = &DefaultClient{Conn: nil} + } defer c.Close() sendRPC := func(elapsed time.Duration) bool { resp, err := c.SendRPC(t, gwAddr, expected, timeoutConfig.MaxTimeToConsistency-elapsed) diff --git a/conformance/utils/suite/suite.go b/conformance/utils/suite/suite.go index bd1e1fe08e..f61f23c589 100644 --- a/conformance/utils/suite/suite.go +++ b/conformance/utils/suite/suite.go @@ -193,9 +193,6 @@ func NewConformanceTestSuite(options ConformanceOptions) (*ConformanceTestSuite, } grpcClient := options.GRPCClient - if grpcClient == nil { - grpcClient = &grpc.DefaultClient{Conn: nil} - } installedCRDs := &apiextensionsv1.CustomResourceDefinitionList{} err := options.Client.List(context.TODO(), installedCRDs)