@@ -251,7 +251,12 @@ func TestProxyHandle_RequestDeadlineExceeded_GRPC(t *testing.T) {
251251
252252 func () {
253253 // Ensure that tunnels aren't leaked with long-running servers.
254- defer goleak .VerifyNone (t , goleak .IgnoreCurrent (), goleak .IgnoreTopFunction ("google.golang.org/grpc.(*addrConn).resetTransport" ))
254+ ignoredGoRoutines := []goleak.Option {
255+ goleak .IgnoreCurrent (),
256+ goleak .IgnoreTopFunction ("google.golang.org/grpc.(*addrConn).resetTransport" ),
257+ goleak .IgnoreTopFunction ("google.golang.org/grpc.(*addrConn).resetTransportAndUnlock" ),
258+ }
259+ defer goleak .VerifyNone (t , ignoredGoRoutines ... )
255260
256261 // run test client
257262 tunnel , err := createSingleUseGrpcTunnel (context .Background (), ps .FrontAddr ())
@@ -309,7 +314,12 @@ func TestProxyDial_RequestCancelled_GRPC(t *testing.T) {
309314
310315 func () {
311316 // Ensure that tunnels aren't leaked with long-running servers.
312- defer goleak .VerifyNone (t , goleak .IgnoreCurrent (), goleak .IgnoreTopFunction ("google.golang.org/grpc.(*addrConn).resetTransport" ))
317+ ignoredGoRoutines := []goleak.Option {
318+ goleak .IgnoreCurrent (),
319+ goleak .IgnoreTopFunction ("google.golang.org/grpc.(*addrConn).resetTransport" ),
320+ goleak .IgnoreTopFunction ("google.golang.org/grpc.(*addrConn).resetTransportAndUnlock" ),
321+ }
322+ defer goleak .VerifyNone (t , ignoredGoRoutines ... )
313323
314324 // run test client
315325 tunnel , err := createSingleUseGrpcTunnel (context .Background (), ps .FrontAddr ())
@@ -404,6 +414,7 @@ func TestProxyDial_RequestCancelled_Concurrent_GRPC(t *testing.T) {
404414 ignoredGoRoutines := []goleak.Option {
405415 goleak .IgnoreCurrent (),
406416 goleak .IgnoreTopFunction ("google.golang.org/grpc.(*addrConn).resetTransport" ),
417+ goleak .IgnoreTopFunction ("google.golang.org/grpc.(*addrConn).resetTransportAndUnlock" ),
407418 }
408419
409420 const concurrentConns = 50
@@ -444,7 +455,12 @@ func TestProxyDial_AgentTimeout_GRPC(t *testing.T) {
444455
445456 func () {
446457 // Ensure that tunnels aren't leaked with long-running servers.
447- defer goleak .VerifyNone (t , goleak .IgnoreCurrent (), goleak .IgnoreTopFunction ("google.golang.org/grpc.(*addrConn).resetTransport" ))
458+ ignoredGoRoutines := []goleak.Option {
459+ goleak .IgnoreCurrent (),
460+ goleak .IgnoreTopFunction ("google.golang.org/grpc.(*addrConn).resetTransport" ),
461+ goleak .IgnoreTopFunction ("google.golang.org/grpc.(*addrConn).resetTransportAndUnlock" ),
462+ }
463+ defer goleak .VerifyNone (t , ignoredGoRoutines ... )
448464
449465 // run test client
450466 tunnel , err := createSingleUseGrpcTunnel (context .Background (), ps .FrontAddr ())
@@ -975,9 +991,13 @@ func resetAllMetrics() {
975991
976992func expectCleanShutdown (t testing.TB ) {
977993 resetAllMetrics ()
978- currentGoRoutines := goleak .IgnoreCurrent ()
994+ ignoredGoRoutines := []goleak.Option {
995+ goleak .IgnoreCurrent (),
996+ goleak .IgnoreTopFunction ("google.golang.org/grpc.(*addrConn).resetTransport" ),
997+ goleak .IgnoreTopFunction ("google.golang.org/grpc.(*addrConn).resetTransportAndUnlock" ),
998+ }
979999 t .Cleanup (func () {
980- goleak .VerifyNone (t , currentGoRoutines , goleak . IgnoreTopFunction ( "google.golang.org/grpc.(*addrConn).resetTransport" ) )
1000+ goleak .VerifyNone (t , ignoredGoRoutines ... )
9811001 if err := clientmetricstest .ExpectClientDialFailures (nil ); err != nil {
9821002 t .Errorf ("Unexpected %s metric: %v" , "dial_failure_total" , err )
9831003 }
0 commit comments