Merge pull request #17793 from mneverov/fix-quorum-check

Fix remove member failed.
This commit is contained in:
Benjamin Wang 2024-04-30 19:52:14 +01:00 committed by GitHub
commit d31caaec4a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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)