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/httputil: TestDumpRequest fails for count=2 #26858
Labels
FrozenDueToAge
help wanted
Testing
An issue that has been verified to require only test changes, not just a test failure.
Milestone
Comments
randall77
added
the
Testing
An issue that has been verified to require only test changes, not just a test failure.
label
Aug 8, 2018
Change https://golang.org/cl/128478 mentions this issue: |
Change https://golang.org/cl/153377 mentions this issue: |
nebulabox
pushed a commit
to nebulabox/go
that referenced
this issue
Feb 18, 2019
TestDumpRequest was failing with -count=2 or more because for test cases that involved mustReadRequest, the body was created as a *bufio.Reader. DumpRequest and DumpRequestOut would then read the body until EOF and would close it after use. However, on re-runs of the test, the body would be terminally exhausted and result in an unexpected error "http: invalid Read on closed Body". The update to the test cases adds an extra field "GetReq" which allows us to construct requests per run of the tests and hence make the test indefinitely re-runnable/idempotent. "Req" or "GetReq" are mutually exclusive: either one of them can be set or nil, but not both. Fixes golang#26858 Change-Id: Ice3083dac1aa3249da4afc7075cd984eb159530d Reviewed-on: https://go-review.googlesource.com/c/153377 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
nebulabox
pushed a commit
to nebulabox/go
that referenced
this issue
Feb 20, 2019
TestDumpRequest was failing with -count=2 or more because for test cases that involved mustReadRequest, the body was created as a *bufio.Reader. DumpRequest and DumpRequestOut would then read the body until EOF and would close it after use. However, on re-runs of the test, the body would be terminally exhausted and result in an unexpected error "http: invalid Read on closed Body". The update to the test cases adds an extra field "GetReq" which allows us to construct requests per run of the tests and hence make the test indefinitely re-runnable/idempotent. "Req" or "GetReq" are mutually exclusive: either one of them can be set or nil, but not both. Fixes golang#26858 Change-Id: Ice3083dac1aa3249da4afc7075cd984eb159530d Reviewed-on: https://go-review.googlesource.com/c/153377 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
FrozenDueToAge
help wanted
Testing
An issue that has been verified to require only test changes, not just a test failure.
The test seems to fail n-1 times for any count n >= 2.
The text was updated successfully, but these errors were encountered: