mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
clientv3/integration: drain keepalives before waiting for leader loss
500ms keepalive delay on proxy side causes client to sometimes send a second keepalive since it waits more than 500ms for the first response. Fixes #7658
This commit is contained in:
parent
8f40517adb
commit
f6d0dda187
@ -729,6 +729,12 @@ func TestLeaseWithRequireLeader(t *testing.T) {
|
||||
}
|
||||
|
||||
clus.Members[1].Stop(t)
|
||||
// kaReqLeader may issue multiple requests while waiting for the first
|
||||
// response from proxy server; drain any stray keepalive responses
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
for len(kaReqLeader) > 0 {
|
||||
<-kaReqLeader
|
||||
}
|
||||
|
||||
select {
|
||||
case resp, ok := <-kaReqLeader:
|
||||
|
Loading…
x
Reference in New Issue
Block a user