]> Cypherpunks.ru repositories - gostls13.git/commit
net/http: add extra synchronization for a Logf call in TestTransportAndServerSharedBo...
authorBryan C. Mills <bcmills@google.com>
Tue, 26 Sep 2023 16:35:57 +0000 (12:35 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 27 Sep 2023 15:58:11 +0000 (15:58 +0000)
commit6cf6067d4eb20dfb3d31c0a8ccdbfdf0bf304b72
tree91085da6e9adc738d5dbb4f72b615a1e62da1c9e
parent4a310877f23140b45bd86a45b8c1fc7d69ba2d29
net/http: add extra synchronization for a Logf call in TestTransportAndServerSharedBodyRace

This race was reported in
https://build.golang.org/log/6f043170946b665edb85b50804a62db68348c52f.

As best as I can tell, it is another instance of #38370. The deferred
call to backend.close() ought to be enough to ensure that the t.Logf
happens before the end of the test, but in practice it is not, and
with enough scheduling delay we can manage to trip the race detector
on a call to Logf after the test function has returned.

Updates #38370.

Change-Id: I5ee45df45c6bfad3239d665df65a138f1c4573a3
Reviewed-on: https://go-review.googlesource.com/c/go/+/531195
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
src/net/http/serve_test.go