diff --git a/server/etcdserver/server.go b/server/etcdserver/server.go index 541cf797c64..2eebb421de1 100644 --- a/server/etcdserver/server.go +++ b/server/etcdserver/server.go @@ -86,7 +86,7 @@ const ( StoreKeysPrefix = "/1" // HealthInterval is the minimum time the cluster should be healthy - // before accepting add member requests. + // before accepting add and delete member requests. HealthInterval = 5 * time.Second purgeFileInterval = 30 * time.Second diff --git a/tests/common/member_test.go b/tests/common/member_test.go index 1f2687c1371..2d1039faba3 100644 --- a/tests/common/member_test.go +++ b/tests/common/member_test.go @@ -196,7 +196,7 @@ func TestMemberRemove(t *testing.T) { continue } t.Run(quorumTc.name+"/"+clusterTc.name, func(t *testing.T) { - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), 14*time.Second) defer cancel() c := clusterTc.config c.StrictReconfigCheck = quorumTc.strictReconfigCheck @@ -207,7 +207,8 @@ func TestMemberRemove(t *testing.T) { testutils.ExecuteUntil(ctx, t, func() { if quorumTc.waitForQuorum { - time.Sleep(etcdserver.HealthInterval) + // wait for health interval + leader election + time.Sleep(etcdserver.HealthInterval + 2*time.Second) } memberID, clusterID := memberToRemove(ctx, t, cc, c.ClusterSize)