]> Cypherpunks.ru repositories - gostls13.git/commit
net/http: avoid leaking goroutines when TestServerGracefulClose retries
authorBryan C. Mills <bcmills@google.com>
Fri, 15 Sep 2023 14:37:08 +0000 (10:37 -0400)
committerGopher Robot <gobot@golang.org>
Fri, 15 Sep 2023 23:22:40 +0000 (23:22 +0000)
commit561a5079057e3a660ab638e1ba957a96c4ff3fd1
treee73de3105bf2d69ef3a37951e1a0deb1b2b7dc79
parent08cdfd06ed1ca21f3b8c95361506ab94c429b622
net/http: avoid leaking goroutines when TestServerGracefulClose retries

If the call to ReadString returns an error, the closure in
testServerGracefulClose will return an error and retry the test with a
longer timeout. If that happens, we need to wait for the conn.Write
goroutine to complete so that we don't leak connections across tests.

Updates #57084.
Fixes #62643.

Change-Id: Ia86c1bbd0a5e5d0aeccf4dfeb994c19d1fb10b00
Reviewed-on: https://go-review.googlesource.com/c/go/+/528398
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
src/net/http/serve_test.go