Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: t.Parallel causes tests to crash with "Test appears to have a leaked Transport" #13804

Closed
odeke-em opened this issue Jan 3, 2016 · 1 comment

Comments

Projects
None yet
3 participants
@odeke-em
Copy link
Member

commented Jan 3, 2016

This is probably a regression from commit 04d732b
as commenting out t.Parallel lets the tests run with the adequate time.
screen shot 2016-01-03 at 5 48 47 am

This consistently happens on

$ uname -a
Darwin Emmanuels-MacBook-Pro.local 15.2.0 Darwin Kernel Version 15.2.0: Fri Nov 13 19:56:56 PST 2015; root:xnu-3248.20.55~2/RELEASE_X86_64 x86_64

The crash dump for three runs is below

$ go test -coverprofile=master-coverage.out
--- FAIL: TestTLSHandshakeTimeout (1.27s)
    main_test.go:112: Test appears to have leaked a Transport:
        net.runtime_pollWait(0x20075e8, 0x72, 0xe40050)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/netpoll.go:160 +0x60
        net.(*pollDesc).Wait(0xc8200540d0, 0x72, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_poll_runtime.go:73 +0x3a
        net.(*pollDesc).WaitRead(0xc8200540d0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_poll_runtime.go:78 +0x36
        net.(*netFD).accept(0xc820054070, 0x0, 0xe4f938, 0xc8205a83e0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_unix.go:426 +0x27c
        net.(*TCPListener).AcceptTCP(0xc82039c008, 0xc82003aea0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/tcpsock_posix.go:254 +0x4d
        net.(*TCPListener).Accept(0xc82039c008, 0x0, 0x0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/tcpsock_posix.go:264 +0x3d
        net/http.(*Server).Serve(0xc8202ca080, 0xe4e870, 0xc82039c008, 0x0, 0x0)
            net/http/_test/_obj_test/server.go:2387 +0x165
        net/http/httptest.(*Server).goServe.func1(0xc820950180)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/httptest/server.go:216 +0x75
        created by net/http/httptest.(*Server).goServe
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/httptest/server.go:217 +0x58

        net/http.(*persistConn).readLoop(0xc8200160c0)
            net/http/_test/_obj_test/transport.go:1272 +0xc73
        created by net/http.(*Transport).dialConn
            net/http/_test/_obj_test/transport.go:922 +0xf60

        net/http.(*persistConn).writeLoop(0xc8200160c0)
            net/http/_test/_obj_test/transport.go:1393 +0x4d6
        created by net/http.(*Transport).dialConn
            net/http/_test/_obj_test/transport.go:923 +0xf85

        net/http_test.TestTransportCancelRequest.func1(0x2042078, 0xc8205f6000, 0xc8205fc0e0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1461 +0xf5
        net/http.HandlerFunc.ServeHTTP(0xc8205de040, 0x2042078, 0xc8205f6000, 0xc8205fc0e0)
            net/http/_test/_obj_test/server.go:1824 +0x44
        net/http.serverHandler.ServeHTTP(0xc8202ca080, 0x2042078, 0xc8205f6000, 0xc8205fc0e0)
            net/http/_test/_obj_test/server.go:2340 +0x1d4
        net/http.(*conn).serve(0xc82007c600)
            net/http/_test/_obj_test/server.go:1719 +0x10b4
        created by net/http.(*Server).Serve
            net/http/_test/_obj_test/server.go:2416 +0x4e4

        testing.RunTests(0x63f560, 0x7e7b20, 0x13a, 0x13a, 0x7d6901)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/testing/testing.go:597 +0x564
        testing.(*M).Run(0xc820034f08, 0xc820049e18)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/testing/testing.go:509 +0x81
        net/http_test.TestMain(0xc820034f08)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/main_test.go:19 +0x21
        main.main()
            net/http/_test/_testmain.go:802 +0x253

        time.Sleep(0x3b9aca00)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/time.go:59 +0xf9
        net/http_test.TestTransportCancelRequest.func2(0xc8202342c0, 0xc8201142a0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1476 +0x20
        created by net/http_test.TestTransportCancelRequest
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1478 +0x54d

        time.Sleep(0x77359400)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/time.go:59 +0xf9
        net/http_test.TestTransportResponseHeaderTimeout.func2(0x2042078, 0xc820016180, 0xc8200c7260)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1392 +0x48
        net/http.HandlerFunc.ServeHTTP(0xc82010c050, 0x2042078, 0xc820016180, 0xc8200c7260)
            net/http/_test/_obj_test/server.go:1824 +0x44
        net/http.(*ServeMux).ServeHTTP(0xc820166090, 0x2042078, 0xc820016180, 0xc8200c7260)
            net/http/_test/_obj_test/server.go:2155 +0x1c3
        net/http.serverHandler.ServeHTTP(0xc82007c680, 0x2042078, 0xc820016180, 0xc8200c7260)
            net/http/_test/_obj_test/server.go:2340 +0x1d4
        net/http.(*conn).serve(0xc8202ca500)
            net/http/_test/_obj_test/server.go:1719 +0x10b4
        created by net/http.(*Server).Serve
            net/http/_test/_obj_test/server.go:2416 +0x4e4
--- FAIL: TestServerTimeouts (1.91s)
    main_test.go:112: Test appears to have leaked a Transport:
        net.runtime_pollWait(0x2005a28, 0x72, 0xe40050)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/netpoll.go:160 +0x60
        net.(*pollDesc).Wait(0xc8202bc140, 0x72, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_poll_runtime.go:73 +0x3a
        net.(*pollDesc).WaitRead(0xc8202bc140, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_poll_runtime.go:78 +0x36
        net.(*netFD).accept(0xc8202bc0e0, 0x0, 0xe4f938, 0xc8205e0340)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_unix.go:426 +0x27c
        net.(*TCPListener).AcceptTCP(0xc820362010, 0xc820037ea0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/tcpsock_posix.go:254 +0x4d
        net.(*TCPListener).Accept(0xc820362010, 0x0, 0x0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/tcpsock_posix.go:264 +0x3d
        net/http.(*Server).Serve(0xc8202ca000, 0xe4e870, 0xc820362010, 0x0, 0x0)
            net/http/_test/_obj_test/server.go:2387 +0x165
        net/http/httptest.(*Server).goServe.func1(0xc82025d620)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/httptest/server.go:216 +0x75
        created by net/http/httptest.(*Server).goServe
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/httptest/server.go:217 +0x58

        net.runtime_pollWait(0x20075e8, 0x72, 0xe40050)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/netpoll.go:160 +0x60
        net.(*pollDesc).Wait(0xc8200540d0, 0x72, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_poll_runtime.go:73 +0x3a
        net.(*pollDesc).WaitRead(0xc8200540d0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_poll_runtime.go:78 +0x36
        net.(*netFD).accept(0xc820054070, 0x0, 0xe4f938, 0xc8205a83e0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_unix.go:426 +0x27c
        net.(*TCPListener).AcceptTCP(0xc82039c008, 0xc82003aea0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/tcpsock_posix.go:254 +0x4d
        net.(*TCPListener).Accept(0xc82039c008, 0x0, 0x0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/tcpsock_posix.go:264 +0x3d
        net/http.(*Server).Serve(0xc8202ca080, 0xe4e870, 0xc82039c008, 0x0, 0x0)
            net/http/_test/_obj_test/server.go:2387 +0x165
        net/http/httptest.(*Server).goServe.func1(0xc820950180)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/httptest/server.go:216 +0x75
        created by net/http/httptest.(*Server).goServe
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/httptest/server.go:217 +0x58

        net/http.(*persistConn).readLoop(0xc8200160c0)
            net/http/_test/_obj_test/transport.go:1272 +0xc73
        created by net/http.(*Transport).dialConn
            net/http/_test/_obj_test/transport.go:922 +0xf60

        net/http.(*persistConn).readLoop(0xc820016240)
            net/http/_test/_obj_test/transport.go:1272 +0xc73
        created by net/http.(*Transport).dialConn
            net/http/_test/_obj_test/transport.go:922 +0xf60

        net/http.(*persistConn).writeLoop(0xc8200160c0)
            net/http/_test/_obj_test/transport.go:1393 +0x4d6
        created by net/http.(*Transport).dialConn
            net/http/_test/_obj_test/transport.go:923 +0xf85

        net/http.(*persistConn).writeLoop(0xc820016240)
            net/http/_test/_obj_test/transport.go:1393 +0x4d6
        created by net/http.(*Transport).dialConn
            net/http/_test/_obj_test/transport.go:923 +0xf85

        net/http_test.TestCancelRequestWithChannel.func1(0x2042078, 0xc8205f6180, 0xc8200c70a0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1571 +0xf5
        net/http.HandlerFunc.ServeHTTP(0xc8205de0d0, 0x2042078, 0xc8205f6180, 0xc8200c70a0)
            net/http/_test/_obj_test/server.go:1824 +0x44
        net/http.serverHandler.ServeHTTP(0xc8202ca000, 0x2042078, 0xc8205f6180, 0xc8200c70a0)
            net/http/_test/_obj_test/server.go:2340 +0x1d4
        net/http.(*conn).serve(0xc8202caa00)
            net/http/_test/_obj_test/server.go:1719 +0x10b4
        created by net/http.(*Server).Serve
            net/http/_test/_obj_test/server.go:2416 +0x4e4

        net/http_test.TestTransportCancelRequest.func1(0x2042078, 0xc8205f6000, 0xc8205fc0e0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1461 +0xf5
        net/http.HandlerFunc.ServeHTTP(0xc8205de040, 0x2042078, 0xc8205f6000, 0xc8205fc0e0)
            net/http/_test/_obj_test/server.go:1824 +0x44
        net/http.serverHandler.ServeHTTP(0xc8202ca080, 0x2042078, 0xc8205f6000, 0xc8205fc0e0)
            net/http/_test/_obj_test/server.go:2340 +0x1d4
        net/http.(*conn).serve(0xc82007c600)
            net/http/_test/_obj_test/server.go:1719 +0x10b4
        created by net/http.(*Server).Serve
            net/http/_test/_obj_test/server.go:2416 +0x4e4

        testing.RunTests(0x63f560, 0x7e7b20, 0x13a, 0x13a, 0x7d6900)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/testing/testing.go:597 +0x564
        testing.(*M).Run(0xc820039f08, 0xc820049e18)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/testing/testing.go:509 +0x81
        net/http_test.TestMain(0xc820039f08)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/main_test.go:19 +0x21
        main.main()
            net/http/_test/_testmain.go:802 +0x253

        time.Sleep(0x3b9aca00)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/time.go:59 +0xf9
        net/http_test.TestCancelRequestWithChannel.func2(0xc82025c240)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1589 +0x20
        created by net/http_test.TestCancelRequestWithChannel
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1591 +0x594

        time.Sleep(0x3b9aca00)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/time.go:59 +0xf9
        net/http_test.TestTransportCancelRequest.func2(0xc8202342c0, 0xc8201142a0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1476 +0x20
        created by net/http_test.TestTransportCancelRequest
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1478 +0x54d

        time.Sleep(0x77359400)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/time.go:59 +0xf9
        net/http_test.TestTransportResponseHeaderTimeout.func2(0x2042078, 0xc820016180, 0xc8200c7260)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1392 +0x48
        net/http.HandlerFunc.ServeHTTP(0xc82010c050, 0x2042078, 0xc820016180, 0xc8200c7260)
            net/http/_test/_obj_test/server.go:1824 +0x44
        net/http.(*ServeMux).ServeHTTP(0xc820166090, 0x2042078, 0xc820016180, 0xc8200c7260)
            net/http/_test/_obj_test/server.go:2155 +0x1c3
        net/http.serverHandler.ServeHTTP(0xc82007c680, 0x2042078, 0xc820016180, 0xc8200c7260)
            net/http/_test/_obj_test/server.go:2340 +0x1d4
        net/http.(*conn).serve(0xc8202ca500)
            net/http/_test/_obj_test/server.go:1719 +0x10b4
        created by net/http.(*Server).Serve
            net/http/_test/_obj_test/server.go:2416 +0x4e4
FAIL
coverage: 79.4% of statements
exit status 1
FAIL    net/http    20.030s
Emmanuels-MacBook-Pro:http emmanuelodeke$ 
Emmanuels-MacBook-Pro:http emmanuelodeke$ go test -coverprofile=master-coverage.out
--- FAIL: TestTLSHandshakeTimeout (1.27s)
    main_test.go:112: Test appears to have leaked a Transport:
        net.runtime_pollWait(0xdc55d8, 0x72, 0xd40050)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/netpoll.go:160 +0x60
        net.(*pollDesc).Wait(0xc82011a0d0, 0x72, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_poll_runtime.go:73 +0x3a
        net.(*pollDesc).WaitRead(0xc82011a0d0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_poll_runtime.go:78 +0x36
        net.(*netFD).accept(0xc82011a070, 0x0, 0xdc2350, 0xc820398620)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_unix.go:426 +0x27c
        net.(*TCPListener).AcceptTCP(0xc82088e010, 0xc82028fea0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/tcpsock_posix.go:254 +0x4d
        net.(*TCPListener).Accept(0xc82088e010, 0x0, 0x0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/tcpsock_posix.go:264 +0x3d
        net/http.(*Server).Serve(0xc820324180, 0xd82720, 0xc82088e010, 0x0, 0x0)
            net/http/_test/_obj_test/server.go:2387 +0x165
        net/http/httptest.(*Server).goServe.func1(0xc8208e6180)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/httptest/server.go:216 +0x75
        created by net/http/httptest.(*Server).goServe
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/httptest/server.go:217 +0x58

        net/http.(*persistConn).readLoop(0xc8201d60c0)
            net/http/_test/_obj_test/transport.go:1272 +0xc73
        created by net/http.(*Transport).dialConn
            net/http/_test/_obj_test/transport.go:922 +0xf60

        net/http.(*persistConn).writeLoop(0xc8201d60c0)
            net/http/_test/_obj_test/transport.go:1393 +0x4d6
        created by net/http.(*Transport).dialConn
            net/http/_test/_obj_test/transport.go:923 +0xf85

        net/http_test.TestTransportCancelRequest.func1(0x1961078, 0xc8200160c0, 0xc820493340)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1461 +0xf5
        net/http.HandlerFunc.ServeHTTP(0xc82038c060, 0x1961078, 0xc8200160c0, 0xc820493340)
            net/http/_test/_obj_test/server.go:1824 +0x44
        net/http.serverHandler.ServeHTTP(0xc820324180, 0x1961078, 0xc8200160c0, 0xc820493340)
            net/http/_test/_obj_test/server.go:2340 +0x1d4
        net/http.(*conn).serve(0xc820324280)
            net/http/_test/_obj_test/server.go:1719 +0x10b4
        created by net/http.(*Server).Serve
            net/http/_test/_obj_test/server.go:2416 +0x4e4

        testing.RunTests(0x63f560, 0x7e7b20, 0x13a, 0x13a, 0x7d6901)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/testing/testing.go:597 +0x564
        testing.(*M).Run(0xc82028df08, 0xc820049e18)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/testing/testing.go:509 +0x81
        net/http_test.TestMain(0xc82028df08)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/main_test.go:19 +0x21
        main.main()
            net/http/_test/_testmain.go:802 +0x253

        time.Sleep(0x3b9aca00)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/time.go:59 +0xf9
        net/http_test.TestTransportCancelRequest.func2(0xc8200c0370, 0xc820492460)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1476 +0x20
        created by net/http_test.TestTransportCancelRequest
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1478 +0x54d

        time.Sleep(0x77359400)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/time.go:59 +0xf9
        net/http_test.TestTransportResponseHeaderTimeout.func2(0x1961078, 0xc8201d6000, 0xc8204920e0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1392 +0x48
        net/http.HandlerFunc.ServeHTTP(0xc8203d2040, 0x1961078, 0xc8201d6000, 0xc8204920e0)
            net/http/_test/_obj_test/server.go:1824 +0x44
        net/http.(*ServeMux).ServeHTTP(0xc8203620c0, 0x1961078, 0xc8201d6000, 0xc8204920e0)
            net/http/_test/_obj_test/server.go:2155 +0x1c3
        net/http.serverHandler.ServeHTTP(0xc82008c080, 0x1961078, 0xc8201d6000, 0xc8204920e0)
            net/http/_test/_obj_test/server.go:2340 +0x1d4
        net/http.(*conn).serve(0xc8200fe100)
            net/http/_test/_obj_test/server.go:1719 +0x10b4
        created by net/http.(*Server).Serve
            net/http/_test/_obj_test/server.go:2416 +0x4e4
--- FAIL: TestServerTimeouts (1.92s)
    main_test.go:112: Test appears to have leaked a Transport:
        net.runtime_pollWait(0xdc55d8, 0x72, 0xd40050)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/netpoll.go:160 +0x60
        net.(*pollDesc).Wait(0xc82011a0d0, 0x72, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_poll_runtime.go:73 +0x3a
        net.(*pollDesc).WaitRead(0xc82011a0d0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_poll_runtime.go:78 +0x36
        net.(*netFD).accept(0xc82011a070, 0x0, 0xdc2350, 0xc820398620)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_unix.go:426 +0x27c
        net.(*TCPListener).AcceptTCP(0xc82088e010, 0xc82028fea0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/tcpsock_posix.go:254 +0x4d
        net.(*TCPListener).Accept(0xc82088e010, 0x0, 0x0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/tcpsock_posix.go:264 +0x3d
        net/http.(*Server).Serve(0xc820324180, 0xd82720, 0xc82088e010, 0x0, 0x0)
            net/http/_test/_obj_test/server.go:2387 +0x165
        net/http/httptest.(*Server).goServe.func1(0xc8208e6180)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/httptest/server.go:216 +0x75
        created by net/http/httptest.(*Server).goServe
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/httptest/server.go:217 +0x58

        net.runtime_pollWait(0xdc5c98, 0x72, 0xd40050)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/netpoll.go:160 +0x60
        net.(*pollDesc).Wait(0xc82011a290, 0x72, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_poll_runtime.go:73 +0x3a
        net.(*pollDesc).WaitRead(0xc82011a290, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_poll_runtime.go:78 +0x36
        net.(*netFD).accept(0xc82011a230, 0x0, 0xdc2350, 0xc8203a4360)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_unix.go:426 +0x27c
        net.(*TCPListener).AcceptTCP(0xc82088e008, 0xc82003aea0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/tcpsock_posix.go:254 +0x4d
        net.(*TCPListener).Accept(0xc82088e008, 0x0, 0x0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/tcpsock_posix.go:264 +0x3d
        net/http.(*Server).Serve(0xc82007c700, 0xd82720, 0xc82088e008, 0x0, 0x0)
            net/http/_test/_obj_test/server.go:2387 +0x165
        net/http/httptest.(*Server).goServe.func1(0xc8208e6240)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/httptest/server.go:216 +0x75
        created by net/http/httptest.(*Server).goServe
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/httptest/server.go:217 +0x58

        net/http.(*persistConn).readLoop(0xc8201d60c0)
            net/http/_test/_obj_test/transport.go:1272 +0xc73
        created by net/http.(*Transport).dialConn
            net/http/_test/_obj_test/transport.go:922 +0xf60

        net/http.(*persistConn).readLoop(0xc8201d6180)
            net/http/_test/_obj_test/transport.go:1272 +0xc73
        created by net/http.(*Transport).dialConn
            net/http/_test/_obj_test/transport.go:922 +0xf60

        net/http.(*persistConn).writeLoop(0xc8201d60c0)
            net/http/_test/_obj_test/transport.go:1393 +0x4d6
        created by net/http.(*Transport).dialConn
            net/http/_test/_obj_test/transport.go:923 +0xf85

        net/http.(*persistConn).writeLoop(0xc8201d6180)
            net/http/_test/_obj_test/transport.go:1393 +0x4d6
        created by net/http.(*Transport).dialConn
            net/http/_test/_obj_test/transport.go:923 +0xf85

        net/http_test.TestCancelRequestWithChannel.func1(0x1961078, 0xc820016180, 0xc8202fa7e0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1571 +0xf5
        net/http.HandlerFunc.ServeHTTP(0xc82038c0c0, 0x1961078, 0xc820016180, 0xc8202fa7e0)
            net/http/_test/_obj_test/server.go:1824 +0x44
        net/http.serverHandler.ServeHTTP(0xc82007c700, 0x1961078, 0xc820016180, 0xc8202fa7e0)
            net/http/_test/_obj_test/server.go:2340 +0x1d4
        net/http.(*conn).serve(0xc82007c680)
            net/http/_test/_obj_test/server.go:1719 +0x10b4
        created by net/http.(*Server).Serve
            net/http/_test/_obj_test/server.go:2416 +0x4e4

        net/http_test.TestTransportCancelRequest.func1(0x1961078, 0xc8200160c0, 0xc820493340)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1461 +0xf5
        net/http.HandlerFunc.ServeHTTP(0xc82038c060, 0x1961078, 0xc8200160c0, 0xc820493340)
            net/http/_test/_obj_test/server.go:1824 +0x44
        net/http.serverHandler.ServeHTTP(0xc820324180, 0x1961078, 0xc8200160c0, 0xc820493340)
            net/http/_test/_obj_test/server.go:2340 +0x1d4
        net/http.(*conn).serve(0xc820324280)
            net/http/_test/_obj_test/server.go:1719 +0x10b4
        created by net/http.(*Server).Serve
            net/http/_test/_obj_test/server.go:2416 +0x4e4

        testing.RunTests(0x63f560, 0x7e7b20, 0x13a, 0x13a, 0x7d6900)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/testing/testing.go:597 +0x564
        testing.(*M).Run(0xc820035f08, 0xc820049e18)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/testing/testing.go:509 +0x81
        net/http_test.TestMain(0xc820035f08)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/main_test.go:19 +0x21
        main.main()
            net/http/_test/_testmain.go:802 +0x253

        time.Sleep(0x3b9aca00)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/time.go:59 +0xf9
        net/http_test.TestCancelRequestWithChannel.func2(0xc8208e6540)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1589 +0x20
        created by net/http_test.TestCancelRequestWithChannel
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1591 +0x594

        time.Sleep(0x3b9aca00)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/time.go:59 +0xf9
        net/http_test.TestTransportCancelRequest.func2(0xc8200c0370, 0xc820492460)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1476 +0x20
        created by net/http_test.TestTransportCancelRequest
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1478 +0x54d

        time.Sleep(0x77359400)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/time.go:59 +0xf9
        net/http_test.TestTransportResponseHeaderTimeout.func2(0x1961078, 0xc8201d6000, 0xc8204920e0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1392 +0x48
        net/http.HandlerFunc.ServeHTTP(0xc8203d2040, 0x1961078, 0xc8201d6000, 0xc8204920e0)
            net/http/_test/_obj_test/server.go:1824 +0x44
        net/http.(*ServeMux).ServeHTTP(0xc8203620c0, 0x1961078, 0xc8201d6000, 0xc8204920e0)
            net/http/_test/_obj_test/server.go:2155 +0x1c3
        net/http.serverHandler.ServeHTTP(0xc82008c080, 0x1961078, 0xc8201d6000, 0xc8204920e0)
            net/http/_test/_obj_test/server.go:2340 +0x1d4
        net/http.(*conn).serve(0xc8200fe100)
            net/http/_test/_obj_test/server.go:1719 +0x10b4
        created by net/http.(*Server).Serve
            net/http/_test/_obj_test/server.go:2416 +0x4e4
FAIL
coverage: 79.4% of statements
exit status 1
FAIL    net/http    21.421s

After commenting out the

// t.Parallel()

line in server_test.go that test no longer crashes as you'll see below.

$ go test -cover
--- FAIL: TestTransportPersistConnLeakShortBody (1.46s)
    transport_test.go:1071: goroutine growth: 29 -> 35 -> 37 (delta: 8)
    transport_test.go:1073: too many new goroutines
    main_test.go:112: Test appears to have leaked a Transport:
        net.runtime_pollWait(0xf61a28, 0x72, 0xc40050)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/netpoll.go:160 +0x60
        net.(*pollDesc).Wait(0xc820468530, 0x72, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_poll_runtime.go:73 +0x3a
        net.(*pollDesc).WaitRead(0xc820468530, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_poll_runtime.go:78 +0x36
        net.(*netFD).accept(0xc8204684d0, 0x0, 0xc4e898, 0xc8205d3d20)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_unix.go:426 +0x27c
        net.(*TCPListener).AcceptTCP(0xc8208ea020, 0xc82012aea0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/tcpsock_posix.go:254 +0x4d
        net.(*TCPListener).Accept(0xc8208ea020, 0x0, 0x0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/tcpsock_posix.go:264 +0x3d
        net/http.(*Server).Serve(0xc8201e4480, 0xf61740, 0xc8208ea020, 0x0, 0x0)
            net/http/_test/_obj_test/server.go:2387 +0x165
        net/http/httptest.(*Server).goServe.func1(0xc82012e6c0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/httptest/server.go:216 +0x75
        created by net/http/httptest.(*Server).goServe
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/httptest/server.go:217 +0x58

        net/http.(*persistConn).readLoop(0xc8207bc300)
            net/http/_test/_obj_test/transport.go:1272 +0xc73
        created by net/http.(*Transport).dialConn
            net/http/_test/_obj_test/transport.go:922 +0xf60

        net/http.(*persistConn).writeLoop(0xc8207bc300)
            net/http/_test/_obj_test/transport.go:1393 +0x4d6
        created by net/http.(*Transport).dialConn
            net/http/_test/_obj_test/transport.go:923 +0xf85

        net/http_test.TestTransportCancelRequest.func1(0xc82078, 0xc8206fa000, 0xc82069c000)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1461 +0xf5
        net/http.HandlerFunc.ServeHTTP(0xc82059e1d0, 0xc82078, 0xc8206fa000, 0xc82069c000)
            net/http/_test/_obj_test/server.go:1824 +0x44
        net/http.serverHandler.ServeHTTP(0xc8201e4480, 0xc82078, 0xc8206fa000, 0xc82069c000)
            net/http/_test/_obj_test/server.go:2340 +0x1d4
        net/http.(*conn).serve(0xc82007a880)
            net/http/_test/_obj_test/server.go:1719 +0x10b4
        created by net/http.(*Server).Serve
            net/http/_test/_obj_test/server.go:2416 +0x4e4

        testing.RunTests(0x63f540, 0x7e7b20, 0x13a, 0x13a, 0x7d6901)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/testing/testing.go:597 +0x564
        testing.(*M).Run(0xc8206c5f08, 0xc820049e18)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/testing/testing.go:509 +0x81
        net/http_test.TestMain(0xc8206c5f08)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/main_test.go:19 +0x21
        main.main()
            net/http/_test/_testmain.go:802 +0x253

        time.Sleep(0x3b9aca00)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/time.go:59 +0xf9
        net/http_test.TestTransportCancelRequest.func2(0xc82073a0b0, 0xc8200c57a0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1476 +0x20
        created by net/http_test.TestTransportCancelRequest
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1478 +0x54d

        time.Sleep(0x77359400)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/time.go:59 +0xf9
        net/http_test.TestTransportResponseHeaderTimeout.func2(0xc82078, 0xc8206fa0c0, 0xc82069c1c0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1392 +0x48
        net/http.HandlerFunc.ServeHTTP(0xc82000a390, 0xc82078, 0xc8206fa0c0, 0xc82069c1c0)
            net/http/_test/_obj_test/server.go:1824 +0x44
        net/http.(*ServeMux).ServeHTTP(0xc820182090, 0xc82078, 0xc8206fa0c0, 0xc82069c1c0)
            net/http/_test/_obj_test/server.go:2155 +0x1c3
        net/http.serverHandler.ServeHTTP(0xc82007a780, 0xc82078, 0xc8206fa0c0, 0xc82069c1c0)
            net/http/_test/_obj_test/server.go:2340 +0x1d4
        net/http.(*conn).serve(0xc8201e4000)
            net/http/_test/_obj_test/server.go:1719 +0x10b4
        created by net/http.(*Server).Serve
            net/http/_test/_obj_test/server.go:2416 +0x4e4
--- FAIL: TestServerTimeouts (1.92s)
    main_test.go:112: Test appears to have leaked a Transport:
        net.runtime_pollWait(0xc88278, 0x72, 0xc40050)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/netpoll.go:160 +0x60
        net.(*pollDesc).Wait(0xc82005c530, 0x72, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_poll_runtime.go:73 +0x3a
        net.(*pollDesc).WaitRead(0xc82005c530, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_poll_runtime.go:78 +0x36
        net.(*netFD).accept(0xc82005c4d0, 0x0, 0xc4e898, 0xc8205d3c20)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_unix.go:426 +0x27c
        net.(*TCPListener).AcceptTCP(0xc820028038, 0xc820128ea0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/tcpsock_posix.go:254 +0x4d
        net.(*TCPListener).Accept(0xc820028038, 0x0, 0x0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/tcpsock_posix.go:264 +0x3d
        net/http.(*Server).Serve(0xc82007a800, 0xf61740, 0xc820028038, 0x0, 0x0)
            net/http/_test/_obj_test/server.go:2387 +0x165
        net/http/httptest.(*Server).goServe.func1(0xc820506120)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/httptest/server.go:216 +0x75
        created by net/http/httptest.(*Server).goServe
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/httptest/server.go:217 +0x58

        net/http.(*persistConn).readLoop(0xc8206fa180)
            net/http/_test/_obj_test/transport.go:1272 +0xc73
        created by net/http.(*Transport).dialConn
            net/http/_test/_obj_test/transport.go:922 +0xf60

        net/http.(*persistConn).writeLoop(0xc8206fa180)
            net/http/_test/_obj_test/transport.go:1393 +0x4d6
        created by net/http.(*Transport).dialConn
            net/http/_test/_obj_test/transport.go:923 +0xf85

        net/http_test.TestCancelRequestWithChannel.func1(0xc82078, 0xc8207bc000, 0xc8205482a0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1571 +0xf5
        net/http.HandlerFunc.ServeHTTP(0xc8205e21b0, 0xc82078, 0xc8207bc000, 0xc8205482a0)
            net/http/_test/_obj_test/server.go:1824 +0x44
        net/http.serverHandler.ServeHTTP(0xc82007a800, 0xc82078, 0xc8207bc000, 0xc8205482a0)
            net/http/_test/_obj_test/server.go:2340 +0x1d4
        net/http.(*conn).serve(0xc82007ad80)
            net/http/_test/_obj_test/server.go:1719 +0x10b4
        created by net/http.(*Server).Serve
            net/http/_test/_obj_test/server.go:2416 +0x4e4

        testing.RunTests(0x63f540, 0x7e7b20, 0x13a, 0x13a, 0x7d6900)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/testing/testing.go:597 +0x564
        testing.(*M).Run(0xc8206c5f08, 0xc820049e18)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/testing/testing.go:509 +0x81
        net/http_test.TestMain(0xc8206c5f08)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/main_test.go:19 +0x21
        main.main()
            net/http/_test/_testmain.go:802 +0x253

        time.Sleep(0x3b9aca00)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/time.go:59 +0xf9
        net/http_test.TestCancelRequestWithChannel.func2(0xc820506180)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1589 +0x20
        created by net/http_test.TestCancelRequestWithChannel
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1591 +0x594

        time.Sleep(0x77359400)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/time.go:59 +0xf9
        net/http_test.TestTransportResponseHeaderTimeout.func2(0xc82078, 0xc8206fa0c0, 0xc82069c1c0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1392 +0x48
        net/http.HandlerFunc.ServeHTTP(0xc82000a390, 0xc82078, 0xc8206fa0c0, 0xc82069c1c0)
            net/http/_test/_obj_test/server.go:1824 +0x44
        net/http.(*ServeMux).ServeHTTP(0xc820182090, 0xc82078, 0xc8206fa0c0, 0xc82069c1c0)
            net/http/_test/_obj_test/server.go:2155 +0x1c3
        net/http.serverHandler.ServeHTTP(0xc82007a780, 0xc82078, 0xc8206fa0c0, 0xc82069c1c0)
            net/http/_test/_obj_test/server.go:2340 +0x1d4
        net/http.(*conn).serve(0xc8201e4000)
            net/http/_test/_obj_test/server.go:1719 +0x10b4
        created by net/http.(*Server).Serve
            net/http/_test/_obj_test/server.go:2416 +0x4e4
--- FAIL: TestTransportCancelRequest (2.02s)
    main_test.go:112: Test appears to have leaked a Transport:
        net.runtime_pollWait(0xc88278, 0x72, 0xc40050)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/netpoll.go:160 +0x60
        net.(*pollDesc).Wait(0xc82005c530, 0x72, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_poll_runtime.go:73 +0x3a
        net.(*pollDesc).WaitRead(0xc82005c530, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_poll_runtime.go:78 +0x36
        net.(*netFD).accept(0xc82005c4d0, 0x0, 0xc4e898, 0xc8205d3c20)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/fd_unix.go:426 +0x27c
        net.(*TCPListener).AcceptTCP(0xc820028038, 0xc820128ea0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/tcpsock_posix.go:254 +0x4d
        net.(*TCPListener).Accept(0xc820028038, 0x0, 0x0, 0x0, 0x0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/tcpsock_posix.go:264 +0x3d
        net/http.(*Server).Serve(0xc82007a800, 0xf61740, 0xc820028038, 0x0, 0x0)
            net/http/_test/_obj_test/server.go:2387 +0x165
        net/http/httptest.(*Server).goServe.func1(0xc820506120)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/httptest/server.go:216 +0x75
        created by net/http/httptest.(*Server).goServe
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/httptest/server.go:217 +0x58

        net/http.(*persistConn).readLoop(0xc8206fa180)
            net/http/_test/_obj_test/transport.go:1272 +0xc73
        created by net/http.(*Transport).dialConn
            net/http/_test/_obj_test/transport.go:922 +0xf60

        net/http.(*persistConn).writeLoop(0xc8206fa180)
            net/http/_test/_obj_test/transport.go:1393 +0x4d6
        created by net/http.(*Transport).dialConn
            net/http/_test/_obj_test/transport.go:923 +0xf85

        net/http_test.TestCancelRequestWithChannel.func1(0xc82078, 0xc8207bc000, 0xc8205482a0)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1571 +0xf5
        net/http.HandlerFunc.ServeHTTP(0xc8205e21b0, 0xc82078, 0xc8207bc000, 0xc8205482a0)
            net/http/_test/_obj_test/server.go:1824 +0x44
        net/http.serverHandler.ServeHTTP(0xc82007a800, 0xc82078, 0xc8207bc000, 0xc8205482a0)
            net/http/_test/_obj_test/server.go:2340 +0x1d4
        net/http.(*conn).serve(0xc82007ad80)
            net/http/_test/_obj_test/server.go:1719 +0x10b4
        created by net/http.(*Server).Serve
            net/http/_test/_obj_test/server.go:2416 +0x4e4

        testing.RunTests(0x63f540, 0x7e7b20, 0x13a, 0x13a, 0x7d6900)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/testing/testing.go:597 +0x564
        testing.(*M).Run(0xc8206c9f08, 0xc820049e18)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/testing/testing.go:509 +0x81
        net/http_test.TestMain(0xc8206c9f08)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/main_test.go:19 +0x21
        main.main()
            net/http/_test/_testmain.go:802 +0x253

        time.Sleep(0x3b9aca00)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/runtime/time.go:59 +0xf9
        net/http_test.TestCancelRequestWithChannel.func2(0xc820506180)
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1589 +0x20
        created by net/http_test.TestCancelRequestWithChannel
            /Users/emmanuelodeke/go/src/go.googlesource.com/go/src/net/http/transport_test.go:1591 +0x594
FAIL
coverage: 79.4% of statements
exit status 1
FAIL    net/http    21.163s

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Jan 4, 2016

@gopherbot

This comment has been minimized.

Copy link

commented Jan 4, 2016

CL https://golang.org/cl/18143 mentions this issue.

@bradfitz bradfitz closed this in 28b95ed Jan 4, 2016

@golang golang locked and limited conversation to collaborators Jan 4, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.