Skip to content

Commit

Permalink
clientv3/integration: increase timeout in watch connection close tests
Browse files Browse the repository at this point in the history
Integration tests have dial timeout 5-sec, and it's possible that
balancer retry logic waits 5-sec and test times out because gRPC calls
grpc.downErr function after connection wait starts in retrial part.
Just increasing time-out should be ok. In most cases, grpc.downErr gets
called before starting the wait.

e.g.

=== RUN   TestWatchErrConnClosed
INFO: 2017/10/18 23:55:39 clientv3/balancer: pin "localhost:91847156765553894590"
INFO: 2017/10/18 23:55:39 clientv3/retry: wait 5s for healthy endpoint
INFO: 2017/10/18 23:55:39 clientv3/balancer: unpin "localhost:91847156765553894590" ("grpc: the client connection is closing")
INFO: 2017/10/18 23:55:39 clientv3/health-balancer: "localhost:91847156765553894590" becomes unhealthy ("grpc: the client connection is closing")
--- FAIL: TestWatchErrConnClosed (3.07s)
        watch_test.go:682: wc.Watch took too long

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
  • Loading branch information
gyuho committed Oct 19, 2017
1 parent 1e217ef commit 430070b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clientv3/integration/watch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ func TestWatchErrConnClosed(t *testing.T) {
clus.TakeClient(0)

select {
case <-time.After(3 * time.Second):
case <-time.After(10 * time.Second):
t.Fatal("wc.Watch took too long")
case <-donec:
}
Expand All @@ -705,7 +705,7 @@ func TestWatchAfterClose(t *testing.T) {
close(donec)
}()
select {
case <-time.After(3 * time.Second):
case <-time.After(10 * time.Second):
t.Fatal("wc.Watch took too long")
case <-donec:
}
Expand Down

0 comments on commit 430070b

Please sign in to comment.