-
Notifications
You must be signed in to change notification settings - Fork 18k
net/http/httptest: "socket is not connected" error after starting httptest.NewServer #9430
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
Comments
Probably running out of ephemeral ports or hitting fd limit. |
If I run it with If I change my So I think this is a different error. |
cc @mikioh who likes stuff like this. |
test-web.go package main
import "github.com/go-martini/martini"
import "runtime"
import (
"log"
)
func main() {
n := runtime.NumCPU()
log.Println("CPU:", n)
runtime.GOMAXPROCS(n)
m := martini.Classic()
m.Get("/", func() string {
return "Hello world!"
})
m.Run()
} boom -cpus 8 -n 10000 -c 240 http://127.0.0.1:3000/ Summary: Status code distribution: Response time histogram: Latency distribution: Error distribution: |
@hannesroth macs have a reduced number of ephemeral port try
This fixes your example for me. |
Reason is the min lifetime of a port on mac os plus the available number of ports, which is bound to run out. |
Timeout. And I don't think there's anything actionable here. We can reopen if anybody disagrees. |
https://gist.github.com/hannesroth/dd9871ca6275fcb435aa
ok proof 0.241s
DONE
ok proof 0.312s
DONE
ok proof 0.419s
DONE
--- FAIL: Test559-8 (0.00s)
proof_test.go:4037: write tcp 127.0.0.1:63671: socket is not connected
go version go1.4 darwin/amd64
Darwin ... 14.0.0 Darwin Kernel Version 14.0.0
We found this when running lots of tests in parallel against our server implementation on our Mac machines. We are unable to reproduce it on a Linux (3.2.51, x86_64) machine.
The text was updated successfully, but these errors were encountered: