]> Cypherpunks repositories - gostls13.git/commit
net/http: ensure server handler is done in TestServerNoWriteTimeout
authorDamien Neil <dneil@google.com>
Fri, 22 Mar 2024 21:33:50 +0000 (14:33 -0700)
committerDamien Neil <dneil@google.com>
Fri, 22 Mar 2024 23:15:35 +0000 (23:15 +0000)
commit8aeec7c5b0c630bb68798bc4b5fc7531b4d26694
treebbca42f43b4d8a20919740716a7d172d1913c185
parent5f5b20c4268c1a3aa6a3b132aeede6dc82adf344
net/http: ensure server handler is done in TestServerNoWriteTimeout

Surprisingly, newClientServerTest doesn't ensure that server handlers
are done in its t.Cleanup function. This test's handler can outlive
the test and attempt to log after the test has completed, causing
race detector failures.

Add an explicit call to Server.Shutdown to ensure the handler
has completed.

We should also probably add a Shutdown to clientServerTest.close,
but that's a larger change; this fixes the immediate problem.

Change-Id: Ibe81b4b382c9c8a920b0ff5f76dea6afe69b10f5
Reviewed-on: https://go-review.googlesource.com/c/go/+/573895
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Damien Neil <dneil@google.com>
src/net/http/serve_test.go