From ae30e5c2fbceb53008573e3b27a4b773f0813712 Mon Sep 17 00:00:00 2001 From: Marek Siarkowicz Date: Tue, 14 Mar 2023 15:43:45 +0100 Subject: [PATCH] tests: Refactor newClient args Signed-off-by: Marek Siarkowicz --- tests/e2e/watch_delay_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/e2e/watch_delay_test.go b/tests/e2e/watch_delay_test.go index 31f017b5d..a4b0b9ed4 100644 --- a/tests/e2e/watch_delay_test.go +++ b/tests/e2e/watch_delay_test.go @@ -75,7 +75,7 @@ func TestWatchDelayForPeriodicProgressNotification(t *testing.T) { clus, err := e2e.NewEtcdProcessCluster(context.Background(), t, e2e.WithConfig(&tc.config)) require.NoError(t, err) defer clus.Close() - c := newClient(t, clus, tc.config) + c := newClient(t, clus.EndpointsV3(), tc.config.Client) require.NoError(t, fillEtcdWithData(context.Background(), c, numberOfPreexistingKeys, sizeOfPreexistingValues)) ctx, cancel := context.WithTimeout(context.Background(), watchTestDuration) @@ -95,7 +95,7 @@ func TestWatchDelayForManualProgressNotification(t *testing.T) { clus, err := e2e.NewEtcdProcessCluster(context.Background(), t, e2e.WithConfig(&tc.config)) require.NoError(t, err) defer clus.Close() - c := newClient(t, clus, tc.config) + c := newClient(t, clus.EndpointsV3(), tc.config.Client) require.NoError(t, fillEtcdWithData(context.Background(), c, numberOfPreexistingKeys, sizeOfPreexistingValues)) ctx, cancel := context.WithTimeout(context.Background(), watchTestDuration) @@ -128,7 +128,7 @@ func TestWatchDelayForEvent(t *testing.T) { clus, err := e2e.NewEtcdProcessCluster(context.Background(), t, e2e.WithConfig(&tc.config)) require.NoError(t, err) defer clus.Close() - c := newClient(t, clus, tc.config) + c := newClient(t, clus.EndpointsV3(), tc.config.Client) require.NoError(t, fillEtcdWithData(context.Background(), c, numberOfPreexistingKeys, sizeOfPreexistingValues)) ctx, cancel := context.WithTimeout(context.Background(), watchTestDuration) @@ -236,13 +236,13 @@ func continuouslyExecuteGetAll(ctx context.Context, t *testing.T, g *errgroup.Gr }) } -func newClient(t *testing.T, clus *e2e.EtcdProcessCluster, cfg e2e.EtcdProcessClusterConfig) *clientv3.Client { - tlscfg, err := tlsInfo(t, cfg.Client) +func newClient(t *testing.T, entpoints []string, cfg e2e.ClientConfig) *clientv3.Client { + tlscfg, err := tlsInfo(t, cfg) if err != nil { t.Fatal(err) } ccfg := clientv3.Config{ - Endpoints: clus.EndpointsV3(), + Endpoints: entpoints, DialTimeout: 5 * time.Second, DialOptions: []grpc.DialOption{grpc.WithBlock()}, }