Documentation
¶
Index ¶
- func AssertQueueDrained(ctx context.Context, t *testing.T, runcnx *params.Run, ns, name string)
- func BounceWatcher(ctx context.Context, t *testing.T, runcnx *params.Run)
- func DenyPipelineRunWrites(ctx context.Context, t *testing.T, runcnx *params.Run, ns string) func()
- func QueueSnapshot(ctx context.Context, t *testing.T, runcnx *params.Run) map[string]queue.RepoQueue
- func ScaleDeployment(ctx context.Context, t *testing.T, runcnx *params.Run, replicas int32, ...)
- type WatcherHealth
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertQueueDrained ¶ added in v0.50.0
AssertQueueDrained checks the watcher is no longer holding a concurrency slot for a repository. A slot that outlives every run it was taken for is a leak, and the next run for that repository will never start.
func BounceWatcher ¶ added in v0.50.0
BounceWatcher scales the watcher down to zero and back up again, waiting for it to come back ready. This is how a test forces the queue to be rebuilt from what is already in the cluster.
func DenyPipelineRunWrites ¶ added in v0.50.0
DenyPipelineRunWrites makes every write to a PipelineRun in one namespace fail, and returns a function that lifts the block again.
The webhook points at a service that does not exist and has a Fail policy, so the API server rejects the request with a "failed calling webhook" error. That is a faithful stand-in for a cluster having a bad minute, and it needs no extra workload to be deployed.
Only the PipelineRun resource is matched, not its status subresource, so Tekton can still report on the runs that are already going.
func QueueSnapshot ¶ added in v0.50.0
func QueueSnapshot(ctx context.Context, t *testing.T, runcnx *params.Run) map[string]queue.RepoQueue
QueueSnapshot asks the watcher what it currently believes about its queues.
The endpoint answers 503 while the reconciler holds the queue lock, since it gives up rather than block the thing it is reporting on. That is expected under load, so retry for a bit before calling it a failure.
Types ¶
type WatcherHealth ¶ added in v0.50.0
type WatcherHealth struct {
// contains filtered or unexported fields
}
WatcherHealth is a snapshot of how many times the watcher has restarted.
func SnapshotWatcherHealth ¶ added in v0.50.0
SnapshotWatcherHealth records the current restart count of every watcher pod.
A watcher that aborts is restarted by Kubernetes and silently rebuilds its queues, so a crash usually leaves the test passing and no assertion looking at it. Comparing restart counts across the test is what makes it visible.