Commit fa6718d0 authored by Ingo Gottwald's avatar Ingo Gottwald Committed by Miek Gieben

Fix grpc test vet warning (#3341)

This fixes the vet warning: the cancel function returned by
context.WithTimeout should be called, not discarded, to avoid a context
leak.
Signed-off-by: default avatarIngo Gottwald <in.gottwald@gmail.com>
parent 575cea44
......@@ -22,7 +22,8 @@ func TestGrpc(t *testing.T) {
}
defer g.Stop()
ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
conn, err := grpc.DialContext(ctx, tcp, grpc.WithInsecure(), grpc.WithBlock())
if err != nil {
t.Fatalf("Expected no error but got: %s", err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment