Documentation
¶
Overview ¶
Package wait is how Golet's tests wait for what happens elsewhere: on the main thread, in another goroutine or process, in the window system or the file system. They wait until it happened, never for a time.
A test that sleeps and then checks, or that gives up after a few seconds, decides on the speed of the machine: a busy CI runner makes it fail although the code is right, and a longer timeout only makes that rarer. Here a wait ends when its condition holds. Guard bounds it only so that a hang fails the test with what never happened rather than stalling the whole run, and it is not to be tuned: nothing a test waits for takes that long when the code is right. A wait that reaches it found a bug (an event lost to a race, a deadlock, a condition that can't become true), and the fix is in the code or the condition.
Index ¶
Constants ¶
const Guard = time.Minute
Guard is the longest a wait waits before it fails the test.
Variables ¶
This section is empty.
Functions ¶
func Context ¶
Context returns a context for calls that wait on one, as Page.EvalContext and FileWatcher.Next do, canceled after Guard or when the test ends.
Types ¶
This section is empty.