]> Cypherpunks repositories - gostls13.git/commit
net/http: deflake and fix TestWrappedResponseController
authorDamien Neil <dneil@google.com>
Wed, 30 Nov 2022 18:43:45 +0000 (13:43 -0500)
committerDamien Neil <dneil@google.com>
Wed, 30 Nov 2022 19:01:44 +0000 (19:01 +0000)
commit648f3febf54465162e095da99149de7a839576c6
treed799d260c9e1e894afa57ab0118615955ff7f0a9
parentc8057d85692c01e96d3c04815a0a364c7cfb4d90
net/http: deflake and fix TestWrappedResponseController

Read the full (empty) response body before closing it,
to avoid cancelling the request while the server handler
is still running.

Wrap the ResponseWriter before calling NewResponseController:
This test is intended to verify that wrapping the controller
works properly, but neglected to actually wrap the controller.

Fixes #56961.

Change-Id: I00269f897448ab34676338707b7a04d19ff17963
Reviewed-on: https://go-review.googlesource.com/c/go/+/453860
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/net/http/responsecontroller_test.go