Skip to main content

Module testing

Module testing 

Source
Expand description

In-process workflow simulation, used by orbit test and orbit simulate.

The Simulator runs the real Engine over an in-memory store with a manual clock. It acts as the worker for every task (asking a TaskHandler for each result), starts child workflows like the server does, sends signals as soon as the execution waits for them, and advances durable time (sleeps, retry backoff, timeouts) straight to the next wake-up whenever nothing else can happen, so simulations finish instantly and deterministically.

Structs§

MockHandler
The worker used by orbit test: answers from the test’s mocks.
SampleHandler
The worker used by orbit simulate: fixed results and failures by task name, and a generated sample for every other task.
SimulatedExecution
One execution of a finished simulation.
Simulation
Simulator
TaskCall
One task handed to the simulated worker.
TestResult
The outcome of one test.

Enums§

TaskOutcome
What the simulated worker does with one task.

Constants§

ROOT_EXECUTION_ID
Id of the execution a simulation starts (children get derived ids).
SIMULATION_EPOCH_MS
Simulated time starts at 2026-01-01T00:00:00Z.

Traits§

TaskHandler

Functions§

run_test
Run one compiled test against workflows (which must include the tested workflow and its children).
sample_value
A deterministic, type-valid sample value (used by orbit simulate for tasks without a mock). name is the field the value is for.
simulate
Run workflow once with handler acting as every worker.