waittest

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT, MIT Imports: 2 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

Overview

Package waittest bounds what a test waits for from another goroutine, so that a hang fails the test, naming what it waited for, instead of stalling the run until the test binary's own timeout.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func For

func For[T any](t testing.TB, ch <-chan T, what string) T

For returns the next value received from ch, failing the test when none arrives within the limit. A closed ch answers at once, which makes a channel closed as a signal one to wait for too.

func ForSlow

func ForSlow[T any](t testing.TB, ch <-chan T, what string) T

ForSlow is For for slow work, a GPU worker on a software rasterizer or a scan of the system's fonts, with the longer slow limit.

func Receive

func Receive[T any](t testing.TB, ch <-chan T, what string) (T, bool)

Receive is For that reports, as a receive does, whether the value was sent (true) or ch was closed (false).

func Until

func Until(t testing.TB, cond func() bool, what string)

Until polls cond until it holds, failing the test when it still does not after the limit.

func UntilSlow

func UntilSlow(t testing.TB, cond func() bool, what string)

UntilSlow is Until for slow work, with the longer slow limit.

Types

This section is empty.

Jump to

Keyboard shortcuts

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