diff --git a/tests/e2e/runtime_reconfiguration_test.go b/tests/e2e/runtime_reconfiguration_test.go index 2cbcad6f9b73..20dd3de6ecb9 100644 --- a/tests/e2e/runtime_reconfiguration_test.go +++ b/tests/e2e/runtime_reconfiguration_test.go @@ -24,7 +24,6 @@ import ( "github.com/stretchr/testify/require" "go.etcd.io/etcd/server/v3/etcdserver" - "go.etcd.io/etcd/tests/v3/framework/e2e" ) @@ -179,11 +178,14 @@ func addMemberAsLearnerAndPromote(ctx context.Context, t *testing.T, epc *e2e.Et id, err := epc.StartNewProc(ctx, nil, t, true /* addAsLearner */) require.NoError(t, err) _, err = epc.Etcdctl(e2e.WithEndpoints(endpoints)).MemberPromote(ctx, id) - attempt := 1 - for err != nil && (attempt < 4) && strings.Contains(err.Error(), "can only promote a learner member which is in sync with leader") { - t.Logf("Learner is not ready yet, retry for the %v time", attempt) - time.Sleep(100 * time.Duration(attempt) * time.Millisecond) + + attempt := 0 + for attempt < 3 { _, err = epc.Etcdctl(e2e.WithEndpoints(endpoints)).MemberPromote(ctx, id) + if err == nil || !strings.Contains(err.Error(), "can only promote a learner member which is in sync with leader") { + break + } + time.Sleep(100 * time.Millisecond) attempt++ } require.NoError(t, err)