From: Michael Pratt Date: Thu, 25 Jan 2024 20:39:09 +0000 (-0500) Subject: net/http: allow nothingWrittenError in TestTransportPersistConnReadLoopEOF X-Git-Tag: go1.23rc1~1354 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3207f038ac10f775c569e12450660c764a3c56af;p=gostls13.git net/http: allow nothingWrittenError in TestTransportPersistConnReadLoopEOF Flakes in #64317 are a result of a race where the server shutdown schedules ahead of the client read loop. Normal network latency usually hides this, but wasm's net_fake.go has very low latency. Explicitly allow the results of this race in the test. For #64317. Change-Id: I9c2572fb44643762fe3f3d7cb133d7e7a8a47881 Reviewed-on: https://go-review.googlesource.com/c/go/+/558595 LUCI-TryBot-Result: Go LUCI Reviewed-by: Damien Neil Auto-Submit: Michael Pratt --- diff --git a/src/net/http/transport_internal_test.go b/src/net/http/transport_internal_test.go index 2ed637e9f0..dc3259fadf 100644 --- a/src/net/http/transport_internal_test.go +++ b/src/net/http/transport_internal_test.go @@ -58,8 +58,8 @@ func TestTransportPersistConnReadLoopEOF(t *testing.T) { <-pc.closech err = pc.closed - if !isTransportReadFromServerError(err) && err != errServerClosedIdle { - t.Errorf("pc.closed = %#v, %v; want errServerClosedIdle or transportReadFromServerError", err, err) + if !isNothingWrittenError(err) && !isTransportReadFromServerError(err) && err != errServerClosedIdle { + t.Errorf("pc.closed = %#v, %v; want errServerClosedIdle or transportReadFromServerError, or nothingWrittenError", err, err) } }