You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
1.6.2
What operating system and processor architecture are you using (go env)?
darwin/amd64
What did you do?
Run the below test:
package keepalive
import (
"net/http""testing""time""github.com/getlantern/fdcount"
)
funcTestIdle(t*testing.T) {
_, counter, err:=fdcount.Matching("TCP")
iferr!=nil {
t.Fatalf("Error getting fd count: %v", err)
}
maxIdleTime:=100*time.Millisecondtr:=&http.Transport{
// MaxIdleTime: maxIdleTime - I'd like to be able to do this
}
client:= http.Client{
Transport: tr,
}
resp, err:=client.Get("https://www.google.com/humans.txt")
iferr!=nil {
t.Fatalf("Unable to make request: %v", err)
}
ifresp.Body!=nil {
resp.Body.Close()
}
time.Sleep(maxIdleTime*2) // doesn't matter how long I sleep here, connection will never go awayerr=counter.AssertDelta(0)
iferr!=nil {
t.Errorf("Wrong number of TCP file descriptors", err)
}
}
Please answer these questions before submitting your issue. Thanks!
go version
)?1.6.2
go env
)?darwin/amd64
Run the below test:
Test passes.
I hope to have a patch available for review later today.
The text was updated successfully, but these errors were encountered: