diff --git a/integration/cluster_test.go b/integration/cluster_test.go index e356564c7fb3..0f7f84713792 100644 --- a/integration/cluster_test.go +++ b/integration/cluster_test.go @@ -412,6 +412,21 @@ func TestRejectUnhealthyRemove(t *testing.T) { c.Members[1].Stop(t) c.WaitLeader(t) + // wait for detecting stopped member disconnection + // each node has initial 20 connections (4 peers * 5 conns) + // after 2 members down, each of 3 nodes should have max 10 connections + // (possibly less via leader election) + for _, i := range []int{2, 3, 4} { + var peern string + for peern != "10" { + peern, _ = c.Members[i].Metric("etcd_network_peer_active_total") + n, _ := strconv.Atoi(peern) + if n < 10 { + break + } + } + } + // reject remove active member since (3,2)-(1,0) => (2,2) lacks quorum err := c.removeMember(t, uint64(c.Members[2].s.ID())) if err == nil {