integrationutil

package
v0.29.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2026 License: BSD-3-Clause Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
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
)

Polling intervals for [assert.EventuallyWithT].

Variables

View Source
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)
)

CI-scaled convergence budgets. ScaledTimeout doubles each on CI.

Functions

func BuildExpectedOnlineMap added in v0.27.0

func BuildExpectedOnlineMap(all map[types.NodeID][]tailcfg.MapResponse) map[types.NodeID]map[types.NodeID]bool

func CreateCertificate added in v0.24.0

func CreateCertificate(hostname string) (caCertPEM, certPEM, keyPEM []byte, err error)

nolint CreateCertificate generates a CA certificate and a server certificate signed by that CA for the given hostname. It returns the CA certificate PEM (for trust stores), server certificate PEM, and server private key PEM.

func FetchPathFromContainer added in v0.22.2

func FetchPathFromContainer(
	pool *dockertest.Pool,
	container *dockertest.Resource,
	path string,
) ([]byte, error)

func PeerSyncRetryInterval added in v0.27.0

func PeerSyncRetryInterval() time.Duration

PeerSyncRetryInterval returns the retry interval for peer synchronization checks.

func PeerSyncTimeout added in v0.27.0

func PeerSyncTimeout() time.Duration

PeerSyncTimeout returns the timeout for peer synchronization based on environment: 60s for dev, 120s for CI.

func ScaledTimeout added in v0.29.0

func ScaledTimeout(d time.Duration) time.Duration

ScaledTimeout returns the given timeout, scaled for CI environments where resource contention causes slower state propagation. Uses a 2x multiplier, consistent with PeerSyncTimeout (60s/120s) and dockertestMaxWait (300s/600s).

func WriteFileToContainer

func WriteFileToContainer(
	pool *dockertest.Pool,
	container *dockertest.Resource,
	path string,
	data []byte,
) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL