Skip to main content

Module testing

Module testing 

Source
Expand description

Deterministic test doubles: a virtual clock and a single-threaded runtime that runs the cache’s detached work to quiescence on demand (feature test-util).

The cache’s detached work and timers go through Runtime, so a single-threaded pool can run every task to quiescence after each command (the causally-ready-v1 settlement of the formal replay) and deliver timers only when a test advances the clock.

Structs§

Absent
The test-only absent value of confirmed-mismatch warnings.
StepRuntime
The test runtime handle: collects tasks for the pool and registers timers on the virtual clock.
TestExecutor
The controlled executor of one test: a single-threaded pool plus the clock and runtime handle every cache instance under test shares.
VirtualClock
Virtual wall, elapsed and scheduler clocks. Scheduler time is what timers are registered against; it moves only when a history delivers timers, so a silent shift never fires a deliberately held timer.

Constants§

ABSENT_MARKER
The name Absent serializes as a unit struct.
WALL_EPOCH_MS
Epoch of every controlled history: 2026-09-08T12:00:00.000Z.

Functions§

grid_clock
The production SystemClock built over a VirtualClock.