mirror of
https://github.com/KusakabeShi/EtherGuard-VPN.git
synced 2024-11-22 07:13:09 +01:00
3591acba76
Picking two free ports to use for a test is difficult. The free port we selected might no longer be free when we reach for it a second time. On my machine, this failure mode led to failures approximately once per thousand test runs. Since failures are rare, and threading through and checking for all possible errors is complicated, fix this with a big hammer: Retry if either device fails to come up. Also, if you accidentally pick the same port twice, delightful confusion ensues. The handshake failures manifest as crypto errors, which look scary. Again, fix with retries. To make these retries easier to implement, use testing.T.Cleanup instead of defer to close devices. This requires Go 1.14. Update go.mod accordingly. Go 1.13 is no longer supported anyway. With these fixes, 'go test -race' ran 100,000 times without failure. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com> |
||
---|---|---|
.. | ||
allowedips_rand_test.go | ||
allowedips_test.go | ||
allowedips.go | ||
bind_test.go | ||
constants.go | ||
cookie_test.go | ||
cookie.go | ||
device_test.go | ||
device.go | ||
endpoint_test.go | ||
indextable.go | ||
ip.go | ||
kdf_test.go | ||
keypair.go | ||
logger.go | ||
misc.go | ||
mobilequirks.go | ||
noise_test.go | ||
noise-helpers.go | ||
noise-protocol.go | ||
noise-types.go | ||
peer_test.go | ||
peer.go | ||
pools.go | ||
queueconstants_android.go | ||
queueconstants_default.go | ||
queueconstants_ios.go | ||
receive.go | ||
send.go | ||
sticky_default.go | ||
sticky_linux.go | ||
timers.go | ||
tun_test.go | ||
tun.go | ||
uapi.go | ||
version.go |