clocktest

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package clocktest contains deterministic testing helpers for clock.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Advance

func Advance(t testing.TB, clock *manual.Clock, duration time.Duration) manual.Result

Advance advances a manual clock, waits for all synchronously triggered work, and fails the current test if either phase reports an error.

func SystemBubble

func SystemBubble(t *testing.T, test func(*testing.T, clock.System))

SystemBubble runs test in a testing/synctest bubble with a System clock. Prefer this helper when the complete unit under test can live inside one bubble. Use dependency-injected manual clocks for explicit business timestamps, wall jumps, and cross-package clock contracts.

func Wait

func Wait(ctx context.Context) error

Wait checks ctx and then waits for every other goroutine in the current synctest bubble to become durably blocked. It must be called from a bubble.

Types

This section is empty.

Jump to

Keyboard shortcuts

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