Navigation Menu

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/httptest: test Server blocked after 5 seconds with StateNew conns #13032

Closed
bradfitz opened this issue Oct 23, 2015 · 4 comments
Closed
Milestone

Comments

@bradfitz
Copy link
Contributor

See https://storage.googleapis.com/go-build-log/cd0968ff/linux-amd64_3f5c4149.log

2015/10/22 23:01:52 httptest.Server blocked in Close after 5 seconds, waiting for connections:
  *net.TCPConn 0xc820692200 127.0.0.1:35530 in state new
panic: test timed out after 3m0s

goroutine 124 [running]:
testing.startAlarm.func1()
    /tmp/workdir/go/src/testing/testing.go:703 +0x132
created by time.goFunc
    /tmp/workdir/go/src/time/sleep.go:129 +0x3a

goroutine 1 [chan receive, 2 minutes]:
testing.RunTests(0x9f7650, 0xb7ac80, 0xf4, 0xf4, 0x701)
    /tmp/workdir/go/src/testing/testing.go:562 +0x8b9
testing.(*M).Run(0xc820183f08, 0x5bdca7)
    /tmp/workdir/go/src/testing/testing.go:494 +0x70
net/http_test.TestMain(0xc820183f08)
    /tmp/workdir/go/src/net/http/main_test.go:19 +0x21
main.main()
    net/http/_test/_testmain.go:584 +0x114

goroutine 17 [syscall, 2 minutes, locked to thread]:
runtime.goexit()
    /tmp/workdir/go/src/runtime/asm_amd64.s:1805 +0x1

goroutine 114 [semacquire, 2 minutes]:
sync.runtime_Semacquire(0xc82018b7dc)
    /tmp/workdir/go/src/runtime/sema.go:43 +0x26
sync.(*WaitGroup).Wait(0xc82018b7d0)
    /tmp/workdir/go/src/sync/waitgroup.go:126 +0xb4
net/http/httptest.(*Server).Close(0xc82018b7a0)
    /tmp/workdir/go/src/net/http/httptest/server.go:170 +0x26a
net/http_test.TestClientWrites(0xc820079950)
    /tmp/workdir/go/src/net/http/client_test.go:572 +0x78a
testing.tRunner(0xc820079950, 0xb7b0e8)
    /tmp/workdir/go/src/testing/testing.go:456 +0x98
created by testing.RunTests
    /tmp/workdir/go/src/testing/testing.go:561 +0x879

From changes in https://go-review.googlesource.com/#/c/15151/

@bradfitz bradfitz self-assigned this Oct 23, 2015
@bradfitz bradfitz added this to the Go1.6 milestone Oct 23, 2015
@bradfitz
Copy link
Contributor Author

@bradfitz
Copy link
Contributor Author

Yup. :( I spent a couple days fighting that CL originally (the one now causing the flakes) and then at the last minute we simplified it, cutting it way back and I thought we made it more reliable (by making it more aggressive). I'll investigate and fix with a vengeance. I hate flakes.

@gopherbot
Copy link

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

chewymeister pushed a commit to pivotal-cf/cf-redis-broker that referenced this issue Oct 7, 2016
Sometimes httptest.Server.Close() seems to block forever. There's an
issue that mentions this problem: golang/go#13032
That issue was supposed to be fixed but we still see this happening on
sometimes. I'm going to lower the request interval in the hope that this
gives the server enough time to shutdown.
@golang golang locked and limited conversation to collaborators Oct 26, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants