mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-25 20:57:31 +00:00
wgengine/magicsock: turn down timeouts in tests
Before: --- PASS: TestActiveDiscovery (11.78s) --- PASS: TestActiveDiscovery/facing_easy_firewalls (5.89s) --- PASS: TestActiveDiscovery/facing_nats (5.89s) --- PASS: TestActiveDiscovery/simple_internet (0.89s) After: --- PASS: TestActiveDiscovery (1.98s) --- PASS: TestActiveDiscovery/facing_easy_firewalls (0.99s) --- PASS: TestActiveDiscovery/facing_nats (0.99s) --- PASS: TestActiveDiscovery/simple_internet (0.89s) Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
This commit is contained in:

committed by
David Crawshaw

parent
eaa0aef934
commit
3552d86525
@@ -3151,16 +3151,6 @@ const (
|
||||
// are sent.
|
||||
heartbeatInterval = 2 * time.Second
|
||||
|
||||
// discoPingInterval is the minimum time between pings
|
||||
// to an endpoint. (Except in the case of CallMeMaybe frames
|
||||
// resetting the counter, as the first pings likely didn't through
|
||||
// the firewall)
|
||||
discoPingInterval = 5 * time.Second
|
||||
|
||||
// pingTimeoutDuration is how long we wait for a pong reply before
|
||||
// assuming it's never coming.
|
||||
pingTimeoutDuration = 5 * time.Second
|
||||
|
||||
// trustUDPAddrDuration is how long we trust a UDP address as the exclusive
|
||||
// path (without using DERP) without having heard a Pong reply.
|
||||
trustUDPAddrDuration = 5 * time.Second
|
||||
@@ -3183,6 +3173,19 @@ const (
|
||||
endpointsFreshEnoughDuration = 27 * time.Second
|
||||
)
|
||||
|
||||
// Constants that are variable for testing.
|
||||
var (
|
||||
// pingTimeoutDuration is how long we wait for a pong reply before
|
||||
// assuming it's never coming.
|
||||
pingTimeoutDuration = 5 * time.Second
|
||||
|
||||
// discoPingInterval is the minimum time between pings
|
||||
// to an endpoint. (Except in the case of CallMeMaybe frames
|
||||
// resetting the counter, as the first pings likely didn't through
|
||||
// the firewall)
|
||||
discoPingInterval = 5 * time.Second
|
||||
)
|
||||
|
||||
// endpointState is some state and history for a specific endpoint of
|
||||
// a endpoint. (The subject is the endpoint.endpointState
|
||||
// map key)
|
||||
|
Reference in New Issue
Block a user