From 2d99b341ad9a3c201ded1255873c783ad2a3b328 Mon Sep 17 00:00:00 2001 From: Bogdan Kanivets Date: Fri, 17 Jun 2022 15:17:48 -0700 Subject: [PATCH] [backport 3.4] clientv3/integration: Reduce flakines of TestGetTokenWithoutAuth backport from branch-3.5: https://github.com/etcd-io/etcd/pull/12200/ Signed-off-by: Bogdan Kanivets --- clientv3/integration/user_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/clientv3/integration/user_test.go b/clientv3/integration/user_test.go index e28e49f2ef8..e49c56651e4 100644 --- a/clientv3/integration/user_test.go +++ b/clientv3/integration/user_test.go @@ -114,7 +114,7 @@ func authSetupRoot(t *testing.T, auth clientv3.Auth) { func TestGetTokenWithoutAuth(t *testing.T) { defer testutil.AfterTest(t) - clus := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 10}) + clus := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 2}) defer clus.Terminate(t) authapi := clus.RandClient() @@ -130,7 +130,7 @@ func TestGetTokenWithoutAuth(t *testing.T) { // "Username" and "Password" must be used cfg := clientv3.Config{ Endpoints: authapi.Endpoints(), - DialTimeout: 1 * time.Second, // make sure all connection time of connect all endpoint must be more DialTimeout + DialTimeout: 5 * time.Second, Username: "root", Password: "123", } @@ -142,7 +142,7 @@ func TestGetTokenWithoutAuth(t *testing.T) { switch err { case nil: - t.Log("passes as expected, but may be connection time less than DialTimeout") + t.Log("passes as expected") case context.DeadlineExceeded: t.Errorf("not expected result:%v with endpoint:%s", err, authapi.Endpoints()) case rpctypes.ErrAuthNotEnabled: @@ -150,5 +150,4 @@ func TestGetTokenWithoutAuth(t *testing.T) { default: t.Errorf("other errors:%v", err) } - }