aboutsummaryrefslogtreecommitdiff
path: root/src/database/sql/driver/driver.go
diff options
context:
space:
mode:
authorEmmanuel T Odeke <emmanuel@orijtech.com>2018-12-08 23:32:15 -0800
committerEmmanuel Odeke <emm.odeke@gmail.com>2019-02-13 16:58:53 +0000
commitb690d7e513737769f6eed7cc53ca088517771547 (patch)
tree6775fb860c2000be9b47b8723a63d7fcea942c0a /src/database/sql/driver/driver.go
parentaf8f4062c24cb36af4dc24fbaffd23aa7f7bde36 (diff)
downloadgo-b690d7e513737769f6eed7cc53ca088517771547.tar.xz
net/http/httputil: make TestDumpRequest idempotent
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 #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>
Diffstat (limited to 'src/database/sql/driver/driver.go')
0 files changed, 0 insertions, 0 deletions