mirror of
https://github.com/juanfont/headscale.git
synced 2026-05-23 18:48:42 +09:00
integration: replace ad-hoc test timeouts with named constants
Categorised timeouts in integrationutil/timeouts.go remove the drift opportunity between same-purpose budgets repeated across the suite. The auth, cli, dns, derp, ssh, and tags tests are swept; acl, route, and general tests follow in later commits alongside their other ergonomic fixes.
This commit is contained in:
40
integration/integrationutil/timeouts.go
Normal file
40
integration/integrationutil/timeouts.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package integrationutil
|
||||
|
||||
import "time"
|
||||
|
||||
// CI-scaled convergence budgets. ScaledTimeout doubles each on CI.
|
||||
var (
|
||||
// HAConvergeTimeout: routes / ACL / policy propagation to reach
|
||||
// every node and show up in status, traceroute, or curl.
|
||||
HAConvergeTimeout = ScaledTimeout(60 * time.Second)
|
||||
|
||||
// HASlowConvergeTimeout: multi-step failover sequences that need
|
||||
// at least one HA prober cycle plus a data-plane settle.
|
||||
HASlowConvergeTimeout = ScaledTimeout(120 * time.Second)
|
||||
|
||||
// PolicyPropagationTimeout: post-SetPolicy filter rules and peer
|
||||
// reachability to reflect the change. Sized for wgengine's
|
||||
// rule-reload lag on contended CI runners (~2 min observed).
|
||||
PolicyPropagationTimeout = ScaledTimeout(180 * time.Second)
|
||||
|
||||
// AuthFlowTimeout: OIDC / web-auth / preauth-key flows to reach
|
||||
// Running.
|
||||
AuthFlowTimeout = ScaledTimeout(30 * time.Second)
|
||||
|
||||
// StatusReadyTimeout: post-event read to reflect the event
|
||||
// (created node visible in list, set tags visible on node).
|
||||
StatusReadyTimeout = ScaledTimeout(30 * time.Second)
|
||||
)
|
||||
|
||||
// Polling intervals for EventuallyWithT.
|
||||
const (
|
||||
// FastPoll: in-process reads (HA state, route table snapshots).
|
||||
FastPoll = 200 * time.Millisecond
|
||||
|
||||
// SlowPoll: cross-container reads (tailscale status, curl,
|
||||
// headscale API) where each tick pays a docker exec round-trip.
|
||||
SlowPoll = 500 * time.Millisecond
|
||||
|
||||
// PingPoll: gap between full ping-matrix sweeps.
|
||||
PingPoll = 2 * time.Second
|
||||
)
|
||||
Reference in New Issue
Block a user