File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -241,7 +241,9 @@ func (s) TestGracefulStopBlocksUntilGRPCConnectionsTerminate(t *testing.T) {
241241 grpcClientCallReturned := make (chan struct {})
242242 go func () {
243243 clt := ss .Client
244- _ , err := clt .UnaryCall (context .Background (), & testpb.SimpleRequest {})
244+ ctx , cancel := context .WithTimeout (context .Background (), defaultTestTimeout )
245+ defer cancel ()
246+ _ , err := clt .UnaryCall (ctx , & testpb.SimpleRequest {})
245247 if err != nil {
246248 t .Errorf ("rpc failed with error: %s" , err )
247249 }
@@ -290,7 +292,9 @@ func (s) TestStopAbortsBlockingGRPCCall(t *testing.T) {
290292 grpcClientCallReturned := make (chan struct {})
291293 go func () {
292294 clt := ss .Client
293- _ , err := clt .UnaryCall (context .Background (), & testpb.SimpleRequest {})
295+ ctx , cancel := context .WithTimeout (context .Background (), defaultTestTimeout )
296+ defer cancel ()
297+ _ , err := clt .UnaryCall (ctx , & testpb.SimpleRequest {})
294298 if err == nil || ! isConnClosedErr (err ) {
295299 t .Errorf ("expected rpc to fail with connection closed error, got: %v" , err )
296300 }
You can’t perform that action at this time.
0 commit comments