mirror of
https://github.com/tailscale/tailscale.git
synced 2025-03-20 05:01:04 +00:00
magicsock: remove test data race
Speculative, I haven't been able to replicate it locally. Fixes #3156 Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
This commit is contained in:
parent
09e692e318
commit
0b62f26349
@ -51,6 +51,13 @@ import (
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
os.Setenv("IN_TS_TEST", "1")
|
os.Setenv("IN_TS_TEST", "1")
|
||||||
|
|
||||||
|
// Some of these tests lose a disco pong before establishing a
|
||||||
|
// direct connection, so instead of waiting 5 seconds in the
|
||||||
|
// test, reduce the wait period.
|
||||||
|
// (In particular, TestActiveDiscovery.)
|
||||||
|
discoPingInterval = 100 * time.Millisecond
|
||||||
|
pingTimeoutDuration = 100 * time.Millisecond
|
||||||
}
|
}
|
||||||
|
|
||||||
// WaitReady waits until the magicsock is entirely initialized and connected
|
// WaitReady waits until the magicsock is entirely initialized and connected
|
||||||
@ -743,18 +750,6 @@ func TestActiveDiscovery(t *testing.T) {
|
|||||||
testActiveDiscovery(t, n)
|
testActiveDiscovery(t, n)
|
||||||
})
|
})
|
||||||
|
|
||||||
// The following tests lose a disco pong before establishing a
|
|
||||||
// direct connection, so instead of waiting 5 seconds in the
|
|
||||||
// test, reduce the wait period.
|
|
||||||
origPingTimeoutDuration := pingTimeoutDuration
|
|
||||||
origDiscoPingInterval := discoPingInterval
|
|
||||||
discoPingInterval = 100 * time.Millisecond
|
|
||||||
pingTimeoutDuration = 100 * time.Millisecond
|
|
||||||
defer func() {
|
|
||||||
pingTimeoutDuration = origPingTimeoutDuration
|
|
||||||
discoPingInterval = origDiscoPingInterval
|
|
||||||
}()
|
|
||||||
|
|
||||||
t.Run("facing_easy_firewalls", func(t *testing.T) {
|
t.Run("facing_easy_firewalls", func(t *testing.T) {
|
||||||
mstun := &natlab.Machine{Name: "stun"}
|
mstun := &natlab.Machine{Name: "stun"}
|
||||||
m1 := &natlab.Machine{
|
m1 := &natlab.Machine{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user