]> Cypherpunks repositories - gostls13.git/commit
net: refactor TestWriteToTimeout
authorBryan C. Mills <bcmills@google.com>
Fri, 10 Dec 2021 19:13:52 +0000 (14:13 -0500)
committerBryan Mills <bcmills@google.com>
Mon, 13 Dec 2021 16:44:13 +0000 (16:44 +0000)
commitacc65b47e12e2ba061b8ab4f86b183d039072776
tree0f8d80eb60808600851586668a92225e1ccf381a
parent4b3d8d1a390a51ea6a1b3f66ef9d56ef7203bbe7
net: refactor TestWriteToTimeout

The test cases for this test had listed specific errors, but the
specific error values were ignored in favor of just calling
isDeadlineExceeded.

Moreover, ENOBUFS errors (which can legitimately occur in the test if
the network interface also happens to be saturated when the timeout
occurs) were not handled at all.

Now the test relies only on the timeout: we iterate until we have seen
two of the expected timeout errors, and if we see ENOBUFS instead of
"deadline exceeded" we back off to give the queues time to drain.

Fixes #49930

Change-Id: I258a6d5c935d9635b02dffd79e197ba9caf83ac8
Reviewed-on: https://go-review.googlesource.com/c/go/+/370882
Trust: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/net/error_plan9_test.go
src/net/error_unix_test.go
src/net/error_windows_test.go
src/net/timeout_test.go