From fae9435b66bb09c33a163875d506313708a2fafc Mon Sep 17 00:00:00 2001 From: Benjamin Wang Date: Tue, 29 Nov 2022 06:48:11 +0800 Subject: [PATCH] test: fix unit test Instability When two members in a 5 member cluster are corrupted, and they have different hashes, etcd will raise alarm for both members, but the order isn't guaranteed. But if the two corrupted members have the same hash, then the order is guaranteed. The leader always raise alarm in the same order as the member list. Signed-off-by: Benjamin Wang --- server/etcdserver/corrupt_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/etcdserver/corrupt_test.go b/server/etcdserver/corrupt_test.go index dd876ca23..3de73aabe 100644 --- a/server/etcdserver/corrupt_test.go +++ b/server/etcdserver/corrupt_test.go @@ -269,7 +269,7 @@ func TestCompactHashCheck(t *testing.T) { {peerInfo: peerInfo{id: 42}, resp: &pb.HashKVResponse{CompactRevision: 1, Hash: 2}}, {peerInfo: peerInfo{id: 43}, resp: &pb.HashKVResponse{CompactRevision: 1, Hash: 2}}, {peerInfo: peerInfo{id: 44}, resp: &pb.HashKVResponse{CompactRevision: 1, Hash: 7}}, - {peerInfo: peerInfo{id: 45}, resp: &pb.HashKVResponse{CompactRevision: 1, Hash: 8}}, + {peerInfo: peerInfo{id: 45}, resp: &pb.HashKVResponse{CompactRevision: 1, Hash: 7}}, }, }, expectActions: []string{"MemberId()", "ReqTimeout()", "Hashes()", "PeerHashByRev(2)", "MemberId()", "TriggerCorruptAlarm(44)", "TriggerCorruptAlarm(45)"},