testsync

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: GPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package testsync supplies minimal synchronisation helpers for tests that must wait on real-world, non-logical-time events (TCP accept, goroutine dispatch, counter updates driven by background workers). For logical-time waits (rate limiter refill, scheduler ticks) inject a fake clock instead — see pkg/beacon/scheduler.go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitFor

func WaitFor(t testing.TB, cond func() bool, timeout time.Duration, what string)

WaitFor polls cond until it returns true or timeout elapses. On timeout it fails the test with t.Fatalf, naming the wait site via what so the diagnostic pinpoints the missing precondition. Callers should pass a short description ("tcp listener bound", "client registered", "n captures recorded") rather than the literal code.

Types

This section is empty.

Jump to

Keyboard shortcuts

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