aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorDamien Neil <dneil@google.com>2022-10-03 16:07:48 -0700
committerDamien Neil <dneil@google.com>2022-10-07 16:53:14 +0000
commit747e1961e95c2eb3df62e045b90b111c2ceea337 (patch)
tree59a7c933ffe695cac3c9c48e8c8e8afa068b0985 /src/testing
parent5ca0cd3f1824f189b6c5edf59b669f22a393e2e1 (diff)
downloadgo-747e1961e95c2eb3df62e045b90b111c2ceea337.tar.xz
net/http: refactor tests to run most in HTTP/1 and HTTP/2 modes
Replace the ad-hoc approach to running tests in HTTP/1 and HTTP/2 modes with a 'run' function that executes a test in various modes. By default, these modes are HTTP/1 and HTTP/2, but tests can opt-in to HTTPS/1 as well. The 'run' function also takes care of post-test cleanup (running the afterTest function). The 'run' function runs tests in parallel by default. Tests which can't run in parallel (generally because they use global test hooks) pass a testNotParallel option to disable parallelism. Update clientServerTest to use t.Cleanup to clean up after itself, rather than leaving this up to tests to handle. Drop an unnecessary mutex in SetReadLoopBeforeNextReadHook. Test hooks can't be set in parallel, and we want the race detector to notify us if two simultaneous tests try to set a hook. Fixes #56032 Change-Id: I16be64913c426fc93d84abc6ad85dbd3bc191224 Reviewed-on: https://go-review.googlesource.com/c/go/+/438137 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/testing')
0 files changed, 0 insertions, 0 deletions