mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
server: fix possible join back in TestRemove
This commit is contained in:
parent
e02baf33c9
commit
92cc288f6e
@ -142,10 +142,17 @@ func TestAdd(t *testing.T) {
|
||||
func TestRemove(t *testing.T) {
|
||||
tests := []int{3, 4, 5, 6}
|
||||
|
||||
for _, tt := range tests {
|
||||
for k, tt := range tests {
|
||||
es, hs := buildCluster(tt, false)
|
||||
waitCluster(t, es)
|
||||
|
||||
lead, _ := waitLeader(es)
|
||||
config := config.NewClusterConfig()
|
||||
config.ActiveSize = 0
|
||||
if err := es[lead].setClusterConfig(config); err != nil {
|
||||
t.Fatalf("#%d: setClusterConfig err = %v", k, err)
|
||||
}
|
||||
|
||||
// we don't remove the machine from 2-node cluster because it is
|
||||
// not 100 percent safe in our raft.
|
||||
// TODO(yichengq): improve it later.
|
||||
@ -184,7 +191,7 @@ func TestRemove(t *testing.T) {
|
||||
}
|
||||
|
||||
if g := <-es[i].modeC; g != standby {
|
||||
t.Errorf("#%d: mode = %d, want standby", i, g)
|
||||
t.Errorf("#%d on %d: mode = %d, want standby", k, i, g)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user