Documentation
¶
Overview ¶
Package wait gives tests load-tolerant waits (gofer-r7am, design docs/design/2026-10-10-flaky-tests-root-cause.md §2.4).
A test that waits for something asynchronous polls a condition until a deadline. Fixed deadlines tuned on an idle machine fail under a full -race run or on a busy Windows CI runner, so every deadline here is multiplied by Scale() (env GOFER_TEST_TIMEOUT_SCALE, default 1) and capped by the test binary's own -timeout. New waits use For / Until; the older per-package waitFor helpers migrate as their tests are touched.
Index ¶
Constants ¶
const EnvScale = "GOFER_TEST_TIMEOUT_SCALE"
EnvScale names the deadline multiplier, e.g. 3 on a slow CI runner.
Variables ¶
This section is empty.
Functions ¶
func For ¶
For polls cond until it reports true or the scaled deadline passes; then it fails the test with what and the last value cond observed. cond returns (done, observed).
func Scale ¶
func Scale() float64
Scale returns the deadline multiplier from GOFER_TEST_TIMEOUT_SCALE (≥ 1; an unset, unparsable or smaller value means 1).
Types ¶
This section is empty.