go/src/net
Ian Lance Taylor 993c387032 os: simplify deadline fluctuation tests
This applies the net package CL 365334, CL 366176, CL 372215 to the os
package.

CL 365334:

    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.

CL 366176:

    It appears that at least the OpenBSD kernel gets sloppier the longer
    the timeout we give it, up to an observed overhead of around 25%.
    Let's give it a little more than that (33%) in the comparison, and
    also increase the growth curve to match the actual observed times
    instead of exponential initial growth.

CL 372215:

    Decrease the slop everywhere else, since NetBSD and OpenBSD seem to be
    the only ones that miss by that much.

For #36108
For #50189
Fixes #50725 (we hope)

Change-Id: I0854d27af67ca9fcf0f9d9e4ff67acff4c2effc8
Reviewed-on: https://go-review.googlesource.com/c/go/+/415234
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-06-30 19:37:21 +00:00
..
http net/http: preserve nil values in Header.Clone 2022-06-29 22:28:30 +00:00
internal/socktest internal/poll, net, syscall: use accept4 on solaris 2022-05-03 14:38:32 +00:00
mail all: gofmt main repo 2022-04-11 16:34:30 +00:00
netip net/netip: add missing ) in ParsePrefix errors 2022-06-15 20:07:10 +00:00
rpc all: gofmt main repo 2022-04-11 16:34:30 +00:00
smtp all: gofmt main repo 2022-04-11 16:34:30 +00:00
testdata net: reject leading zeros in IP address parsers 2021-06-08 20:23:22 +00:00
textproto all: gofmt main repo 2022-04-11 16:34:30 +00:00
url net/url: fix regex typo in comment in url.go 2022-04-30 04:04:40 +00:00
addrselect.go net: permit use of Resolver.PreferGo, netgo on Windows and Plan 9 2022-05-30 21:23:29 +00:00
addrselect_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
cgo_aix.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
cgo_android.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
cgo_bsd.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
cgo_linux.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
cgo_netbsd.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
cgo_openbsd.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
cgo_resnew.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
cgo_resold.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
cgo_socknew.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
cgo_sockold.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
cgo_solaris.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
cgo_stub.go net: don't set netGo = true on Windows with no cgo 2022-06-22 16:18:44 +00:00
cgo_unix.go all: gofmt main repo 2022-04-11 16:34:30 +00:00
cgo_unix_test.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
cgo_windows.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
conf.go net: permit use of Resolver.PreferGo, netgo on Windows and Plan 9 2022-05-30 21:23:29 +00:00
conf_netcgo.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
conf_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
conn_test.go net: lengthen arbitrary SetDeadline timeout by a few orders of magnitude 2021-12-17 02:00:14 +00:00
dial.go net: fix testHookDialTCP race 2022-06-08 17:11:00 +00:00
dial_test.go net: avoid darwin_arm64 bug in TestDialParallelSpuriousConnection 2022-06-13 19:00:03 +00:00
dial_unix_test.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
dnsclient.go net: use fastrand64 in randInt 2022-04-21 17:46:26 +00:00
dnsclient_test.go
dnsclient_unix.go net: permit use of Resolver.PreferGo, netgo on Windows and Plan 9 2022-05-30 21:23:29 +00:00
dnsclient_unix_test.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
dnsconfig.go net: permit use of Resolver.PreferGo, netgo on Windows and Plan 9 2022-05-30 21:23:29 +00:00
dnsconfig_unix.go net: permit use of Resolver.PreferGo, netgo on Windows and Plan 9 2022-05-30 21:23:29 +00:00
dnsconfig_unix_test.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
dnsconfig_windows.go net: permit use of Resolver.PreferGo, netgo on Windows and Plan 9 2022-05-30 21:23:29 +00:00
dnsname_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
error_plan9.go
error_plan9_test.go net: refactor TestWriteToTimeout 2021-12-13 16:44:13 +00:00
error_posix.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
error_posix_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
error_test.go net: support error.Is of network errors and context errors 2022-04-03 15:43:15 +00:00
error_unix.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
error_unix_test.go net: refactor TestWriteToTimeout 2021-12-13 16:44:13 +00:00
error_windows.go
error_windows_test.go net: refactor TestWriteToTimeout 2021-12-13 16:44:13 +00:00
example_test.go net: add examples for remaining IP functions 2021-10-13 16:36:59 +00:00
external_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
fcntl_libc_test.go all: separate doc comment from //go: directives 2022-04-05 17:54:15 +00:00
fcntl_syscall_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
fd_plan9.go
fd_posix.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
fd_unix.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
fd_windows.go
file.go
file_plan9.go
file_stub.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
file_test.go net: pass a testing.TB to newLocal* helpers 2021-12-13 16:42:23 +00:00
file_unix.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
file_windows.go
hook.go
hook_plan9.go
hook_unix.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
hook_windows.go
hosts.go net: avoid memory copy calling absDomainName 2021-08-16 21:38:38 +00:00
hosts_test.go net: avoid memory copy calling absDomainName 2021-08-16 21:38:38 +00:00
interface.go
interface_aix.go internal/syscall/unix: change Ioctl arg type to unsafe.Pointer on AIX 2021-08-16 16:58:24 +00:00
interface_bsd.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
interface_bsd_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
interface_bsdvar.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
interface_darwin.go
interface_freebsd.go net: don't use syscall.NET_RT_IFLISTL on FreeBSD 2021-10-02 16:05:55 +00:00
interface_linux.go
interface_linux_test.go
interface_plan9.go
interface_solaris.go
interface_stub.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
interface_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
interface_unix_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
interface_windows.go
ip.go net: do not panic on nil IPNet.String() 2022-01-05 01:53:39 +00:00
ip_test.go net: do not panic on nil IPNet.String() 2022-01-05 01:53:39 +00:00
iprawsock.go
iprawsock_plan9.go
iprawsock_posix.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
iprawsock_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
ipsock.go
ipsock_plan9.go
ipsock_plan9_test.go
ipsock_posix.go all: gofmt main repo 2022-04-11 16:34:30 +00:00
ipsock_test.go
listen_test.go net: avoid racing on port reuse in TestListenConfigControl 2022-05-09 18:10:01 +00:00
lookup.go net: permit use of Resolver.PreferGo, netgo on Windows and Plan 9 2022-05-30 21:23:29 +00:00
lookup_fake.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
lookup_plan9.go net: permit use of Resolver.PreferGo, netgo on Windows and Plan 9 2022-05-30 21:23:29 +00:00
lookup_test.go net: fix a race in TestLookupContextCancel 2022-02-09 20:12:16 +00:00
lookup_unix.go net: permit use of Resolver.PreferGo, netgo on Windows and Plan 9 2022-05-30 21:23:29 +00:00
lookup_windows.go net: avoid infinite recursion in Windows Resolver.lookupTXT 2022-06-15 00:03:12 +00:00
lookup_windows_test.go net: really skip Windows PTR tests if we say we are skipping them 2022-06-27 22:22:47 +00:00
mac.go all: gofmt main repo 2022-04-11 16:34:30 +00:00
mac_test.go
main_cloexec_test.go internal/poll, net, syscall: use accept4 on solaris 2022-05-03 14:38:32 +00:00
main_conf_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
main_noconf_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
main_plan9_test.go
main_posix_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
main_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
main_unix_test.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
main_windows_test.go
mockserver_test.go net: avoid racing on port reuse in TestListenConfigControl 2022-05-09 18:10:01 +00:00
net.go net: permit use of Resolver.PreferGo, netgo on Windows and Plan 9 2022-05-30 21:23:29 +00:00
net_fake.go net: permit use of Resolver.PreferGo, netgo on Windows and Plan 9 2022-05-30 21:23:29 +00:00
net_test.go net: avoid darwin/arm64 platform bug in TestCloseWrite 2022-06-27 18:18:08 +00:00
net_windows_test.go net: skip tests that use netsh on the windows-arm64-10 builder 2022-03-31 21:21:20 +00:00
netgo.go net: don't set netGo = true on Windows with no cgo 2022-06-22 16:18:44 +00:00
netgo_unix_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
nss.go net: permit use of Resolver.PreferGo, netgo on Windows and Plan 9 2022-05-30 21:23:29 +00:00
nss_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
packetconn_test.go net: create unix sockets in unique directories 2021-12-13 16:42:31 +00:00
parse.go net/netip: add new IP address package 2021-11-02 01:28:01 +00:00
parse_test.go net/netip: add new IP address package 2021-11-02 01:28:01 +00:00
pipe.go
pipe_test.go
platform_test.go all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
port.go
port_test.go
port_unix.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
protoconn_test.go net: create unix sockets in unique directories 2021-12-13 16:42:31 +00:00
rawconn.go
rawconn_stub_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
rawconn_test.go net: pass a testing.TB to newLocal* helpers 2021-12-13 16:42:23 +00:00
rawconn_unix_test.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
rawconn_windows_test.go
resolverdialfunc_test.go net: permit use of Resolver.PreferGo, netgo on Windows and Plan 9 2022-05-30 21:23:29 +00:00
sendfile_linux.go
sendfile_stub.go net: do not use sendfile on iOS 2021-12-01 15:58:46 +00:00
sendfile_test.go net: pass a testing.TB to newLocal* helpers 2021-12-13 16:42:23 +00:00
sendfile_unix_alt.go net: do not use sendfile on iOS 2021-12-01 15:58:46 +00:00
sendfile_windows.go
server_test.go net: create unix sockets in unique directories 2021-12-13 16:42:31 +00:00
sock_bsd.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
sock_cloexec.go net: remove fallback path in sysSocket 2022-05-03 18:23:13 +00:00
sock_linux.go all: gofmt main repo 2022-04-11 16:34:30 +00:00
sock_linux_test.go
sock_plan9.go
sock_posix.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
sock_stub.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
sock_windows.go
sockaddr_posix.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
sockopt_aix.go
sockopt_bsd.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
sockopt_linux.go
sockopt_plan9.go
sockopt_posix.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
sockopt_solaris.go
sockopt_stub.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
sockopt_windows.go
sockoptip_bsdvar.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
sockoptip_linux.go
sockoptip_posix.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
sockoptip_stub.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
sockoptip_windows.go
splice_linux.go
splice_stub.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
splice_test.go net: create unix sockets in unique directories 2021-12-13 16:42:31 +00:00
sys_cloexec.go internal/poll, net, syscall: use accept4 on solaris 2022-05-03 14:38:32 +00:00
tcpsock.go net: add conversion from AddrPort to TCPAddr to complement existing inverse 2021-11-11 11:00:33 +00:00
tcpsock_plan9.go net: fix testHookDialTCP race 2022-06-08 17:11:00 +00:00
tcpsock_posix.go net: fix testHookDialTCP race 2022-06-08 17:11:00 +00:00
tcpsock_test.go net: pass a testing.TB to newLocal* helpers 2021-12-13 16:42:23 +00:00
tcpsock_unix_test.go net: pass a testing.TB to newLocal* helpers 2021-12-13 16:42:23 +00:00
tcpsockopt_darwin.go
tcpsockopt_dragonfly.go
tcpsockopt_openbsd.go
tcpsockopt_plan9.go
tcpsockopt_posix.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
tcpsockopt_solaris.go
tcpsockopt_stub.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
tcpsockopt_unix.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
tcpsockopt_windows.go
timeout_test.go os: simplify deadline fluctuation tests 2022-06-30 19:37:21 +00:00
udpsock.go net: do more faithful conversion from AddrPort to UDPAddr 2021-11-10 22:16:25 +00:00
udpsock_plan9.go net: add ReadFromUDPAddrPort 2021-11-02 18:35:35 +00:00
udpsock_plan9_test.go
udpsock_posix.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
udpsock_test.go net: remove an arbitrary timeout in TestUDPReadSizeError 2022-02-03 05:57:46 +00:00
unixsock.go
unixsock_linux_test.go
unixsock_plan9.go
unixsock_posix.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
unixsock_readmsg_cloexec.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
unixsock_readmsg_cmsg_cloexec.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
unixsock_readmsg_other.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
unixsock_readmsg_test.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
unixsock_test.go net: create unix sockets in unique directories 2021-12-13 16:42:31 +00:00
unixsock_windows_test.go net: create unix sockets in unique directories 2021-12-13 16:42:31 +00:00
write_unix_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
writev_test.go net: pass a testing.TB to newLocal* helpers 2021-12-13 16:42:23 +00:00
writev_unix.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00