aboutsummaryrefslogtreecommitdiff
path: root/go.mod
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josh@tailscale.com>2020-12-08 19:23:56 -0800
committerJason A. Donenfeld <Jason@zx2c4.com>2020-12-10 22:37:10 +0100
commita5a9c0db00261b50ef790eb7bb318fc9c1a56aa5 (patch)
tree0202f340d40513e9d53d612f3646390c2a606642 /go.mod
parent310ae107c346178c2d985792665dcd071ebc044b (diff)
downloadwireguard-go-a5a9c0db00261b50ef790eb7bb318fc9c1a56aa5.tar.gz
wireguard-go-a5a9c0db00261b50ef790eb7bb318fc9c1a56aa5.zip
device: make test setup more robust
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>
Diffstat (limited to '')
-rw-r--r--go.mod2
1 files changed, 1 insertions, 1 deletions
diff --git a/go.mod b/go.mod
index 22e0b95..1dbdb67 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
module golang.zx2c4.com/wireguard
-go 1.13
+go 1.14
require (
golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392