Documentation
¶
Index ¶
Constants ¶
const DefaultTimeout = 10 * time.Second
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LockStep ¶
type LockStep struct {
// contains filtered or unexported fields
}
Lockstep is a testing primitive.
func New ¶
New creates a LockStep instance. The provided test context will be used for logging and for timeout failures.
func (*LockStep) Emit ¶
Emit will emit the message m. It will block until a corresponding Wait operation for m is processed.
func (*LockStep) SetTimeout ¶
SetTimeout overrides DefaultTimeout for Emit and Wait operations. Increase the timeout when debugging.
func (*LockStep) SetVerbose ¶
SetVerbose configures verbose mode. If enabled, LockStep will emit detailed logs using t.Logf. Useful for debugging.
func (*LockStep) Wait ¶
Wait waits for all the provided messages. It will block until Emit operations corresponding to all messages have been processed.
The order of Emit operations does not matter.
ls.Wait("x", "y")
This Wait will be fulfilled if x and y are emitted in any order. Conversely:
ls.Wait("x")
ls.Wait("y")
This Wait will only be fulfilled if x and y are emitted in order.