clientv3/integration: fix "TestLeaseKeepAliveNotFound"

with "default" select, the failure case will never be selected

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
release-3.5
Gyuho Lee 2020-01-17 12:04:10 -08:00
parent 255944bf51
commit 091b84f154
1 changed files with 3 additions and 9 deletions

View File

@ -268,16 +268,10 @@ func TestLeaseKeepAliveNotFound(t *testing.T) {
<-lchs[0].ch <-lchs[0].ch
if _, ok := <-lchs[0].ch; !ok { if _, ok := <-lchs[0].ch; !ok {
t.Fatalf("closed keepalive on wrong lease") t.Fatal("closed keepalive on wrong lease")
} }
if _, ok := <-lchs[1].ch; ok {
timec := time.After(5 * time.Second) t.Fatal("expected closed keepalive")
for range lchs[1].ch {
select {
case <-timec:
t.Fatalf("revoke did not close keep alive")
default:
}
} }
} }