Skip to content

Commit

Permalink
client/integration: try to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nolouch committed Sep 17, 2018
1 parent c15fb60 commit 4c0b00a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 5 additions & 5 deletions clientv3/integration/kv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,11 @@ func TestKVGetErrConnClosed(t *testing.T) {
cli := clus.Client(0)

donec := make(chan struct{})
if err := cli.Close(); err != nil {
t.Fatal(err)
}
clus.TakeClient(0)

go func() {
defer close(donec)
_, err := cli.Get(context.TODO(), "foo")
Expand All @@ -447,11 +452,6 @@ func TestKVGetErrConnClosed(t *testing.T) {
}
}()

if err := cli.Close(); err != nil {
t.Fatal(err)
}
clus.TakeClient(0)

select {
case <-time.After(integration.RequestWaitTimeout):
t.Fatal("kv.Get took too long")
Expand Down
7 changes: 3 additions & 4 deletions clientv3/integration/lease_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ func TestLeaseGrantErrConnClosed(t *testing.T) {

cli := clus.Client(0)
clus.TakeClient(0)
if err := cli.Close(); err != nil {
t.Fatal(err)
}

donec := make(chan struct{})
go func() {
Expand All @@ -303,10 +306,6 @@ func TestLeaseGrantErrConnClosed(t *testing.T) {
}
}()

if err := cli.Close(); err != nil {
t.Fatal(err)
}

select {
case <-time.After(integration.RequestWaitTimeout):
t.Fatal("le.Grant took too long")
Expand Down

0 comments on commit 4c0b00a

Please sign in to comment.