]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: allow nothingWrittenError in TestTransportPersistConnReadLoopEOF
authorMichael Pratt <mpratt@google.com>
Thu, 25 Jan 2024 20:39:09 +0000 (15:39 -0500)
committerGopher Robot <gobot@golang.org>
Mon, 29 Jan 2024 22:31:23 +0000 (22:31 +0000)
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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>

src/net/http/transport_internal_test.go

index 2ed637e9f036cac04101c689803d26130b484827..dc3259fadf90b67ee24bcdf2ccda813afe5d2953 100644 (file)
@@ -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)
        }
 }