]> Cypherpunks repositories - gostls13.git/commit
net: simplify deadline fluctuation tests
authorBryan C. Mills <bcmills@google.com>
Thu, 18 Nov 2021 21:07:13 +0000 (16:07 -0500)
committerBryan C. Mills <bcmills@google.com>
Fri, 19 Nov 2021 21:59:14 +0000 (21:59 +0000)
commit5e774b0f5c9e9d5a0dab94620d2e0030226148c2
treeea29acb379670ea1dd35ddc5f7926131cd2ab69e
parent6027b2183d9a63a11f92d392fd2296e7b88402fc
net: simplify deadline fluctuation tests

These tests were checking for fairly narrow timing windows, but were
running in parallel and heavily dependent on timer and goroutine
scheduling. This change eliminates unnecessary goroutines, runs the
tests sequentially (dramatically shortening the timeouts to reduce the
penalty of doing so), and uses timestamp comparison instead of
background timers to hopefully gain some robustness from monotonic
timestamps.

Many of the other tests from this package would benefit from similar
simplifications, which we can apply if and when we notice flaky
failures or want to improve the latency of running the test.

Fixes #36108

Change-Id: I17d8af7d2eefb1ec14fe0d9d891142a39599a562
Reviewed-on: https://go-review.googlesource.com/c/go/+/365334
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
src/net/mockserver_test.go
src/net/timeout_test.go