aion/testing/clock

Simulated clock helpers for aion/testing.

Advancing the clock updates process-scoped harness state only. It never uses wall-clock timers, so sleeps and durable timers exercised by workflow tests complete instantly under gleam test.

Values

pub fn advance(
  env: env,
  by: duration.Duration,
) -> Result(env, error.EngineError)

Advance the current process’s logical clock by by.

The test FFI double marks any recorded sleeps or timers whose deadline is now reached as fired and returns immediately without wall-clock waiting.

pub fn current_time_milliseconds(
  env: env,
) -> Result(Int, error.EngineError)

Return the current logical clock value for the current process.

Search Document