integration: fix decrease cluster tests

This commit is contained in:
Yicheng Qin 2015-02-21 18:18:57 -08:00
parent 1c5a507761
commit 87e3de8b8b

View File

@ -346,8 +346,10 @@ func (c *cluster) RemoveMember(t *testing.T, id uint64) {
select {
case <-m.s.StopNotify():
m.Terminate(t)
// 1s stop delay + election timeout + 1s disk and network delay
case <-time.After(time.Second + time.Duration(electionTicks)*tickDuration + time.Second):
// 1s stop delay + election timeout + 1s disk and network delay + connection write timeout
// TODO: remove connection write timeout by selecting on http response closeNotifier
// blocking on https://github.com/golang/go/issues/9524
case <-time.After(time.Second + time.Duration(electionTicks)*tickDuration + time.Second + rafthttp.ConnWriteTimeout):
t.Fatalf("failed to remove member %s in time", m.s.ID())
}
}