]> git.ipfire.org Git - thirdparty/wireguard-go.git/commit
device: fix goroutine leak test
authorJosh Bleecher Snyder <josh@tailscale.com>
Wed, 3 Feb 2021 16:26:27 +0000 (08:26 -0800)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 3 Feb 2021 16:45:22 +0000 (17:45 +0100)
commit91617b4c522eaa034d39b208edc8221ba52e0954
tree9a0a613d027c96ffb082f8f1d415daa19e2f96bd
parent7258a8973dfb2e3069fe1a8364966cfaadbdb4e1
device: fix goroutine leak test

The leak test had rare flakes.
If a system goroutine started at just the wrong moment, you'd get a false positive.
Instead of looping until the goroutines look good and then checking,
exit completely as soon as the number of goroutines looks good.
Also, check more frequently, in an attempt to complete faster.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
device/device_test.go