@@ -309,7 +309,9 @@ func (s) TestNewClientHandshaker(t *testing.T) {
309309 conn := testutil .NewTestConn (nil , nil )
310310 clientConn := & grpc.ClientConn {}
311311 opts := & ClientHandshakerOptions {}
312- hs , err := NewClientHandshaker (context .Background (), clientConn , conn , opts )
312+ ctx , cancel := context .WithTimeout (context .Background (), defaultTestTimeout )
313+ defer cancel ()
314+ hs , err := NewClientHandshaker (ctx , clientConn , conn , opts )
313315 if err != nil {
314316 t .Errorf ("NewClientHandshaker returned unexpected error: %v" , err )
315317 }
@@ -341,7 +343,9 @@ func (s) TestNewServerHandshaker(t *testing.T) {
341343 conn := testutil .NewTestConn (nil , nil )
342344 clientConn := & grpc.ClientConn {}
343345 opts := & ServerHandshakerOptions {}
344- hs , err := NewServerHandshaker (context .Background (), clientConn , conn , opts )
346+ ctx , cancel := context .WithTimeout (context .Background (), defaultTestTimeout )
347+ defer cancel ()
348+ hs , err := NewServerHandshaker (ctx , clientConn , conn , opts )
345349 if err != nil {
346350 t .Errorf ("NewServerHandshaker returned unexpected error: %v" , err )
347351 }
0 commit comments