Skip to content

Commit

Permalink
integration: wait 'TestRejectUnhealthyRemove' until disconnection
Browse files Browse the repository at this point in the history
Fix #7609.

Signed-off-by: Gyu-Ho Lee <[email protected]>
  • Loading branch information
gyuho committed Apr 6, 2017
1 parent 122eae6 commit c194ea1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions integration/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit c194ea1

Please sign in to comment.