Skip to content

Commit

Permalink
client: added error logging for Put request
Browse files Browse the repository at this point in the history
Signed-off-by: AngstyDuck <[email protected]>
  • Loading branch information
AngstyDuck committed Sep 7, 2023
1 parent 357f70d commit d0ac5df
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/integration/clientv3/concurrency/session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,12 @@ func TestTimeoutDoesntAffectSubsequentConnections(t *testing.T) {
clus.Members[0].Terminate(t)

donec := make(chan struct{})
errorc := make(chan error)
go func() {
defer close(donec)
_, _ = cli.Put(s.Ctx(), "sample_key", "sample_value", clientv3.WithLease(s.Lease()))
if _, err := cli.Put(s.Ctx(), "sample_key", "sample_value", clientv3.WithLease(s.Lease())); err != nil {
errorc <- err
}
}()

select {
Expand All @@ -188,6 +191,8 @@ func TestTimeoutDoesntAffectSubsequentConnections(t *testing.T) {
clus.Members[0].Restart(t)
select {
case <-donec:
case err := <-errorc:
t.Errorf("Put failed: %v", err)
case <-time.After(1 * time.Second):
t.Fatal("Put function hung even after restarting cluster")
}
Expand Down

0 comments on commit d0ac5df

Please sign in to comment.