type.test_clock_context
The clock is moved outside a test.
Area 13, Testing; not declinable; the next step is usually the agent's.
Application code cannot move the clock:
type ShiftEnd = Instant {}action end_shift() -> ShiftEnd { clock.advance(5m) return ShiftEnd(clock.now)}
error An action can't move the clock
--> main.jadpo:4:5
|4 | clock.advance(5m) | ^^^^^^^^^^^^^ moves the clock
- reason
- Only a test moves its clock: elsewhere the time is the operation's
clock.now, fixed while it runs, and a later request or schedule run reads a later one. - next
- Move the clock in a test with
clock.advance(...), or remove this line (agent) - rule
- type.
test_ clock_ context - help
- https://jadpo.
dev/docs/errors/type. test_ clock_ context
Markdown for agents: /docs/errors/type.test_clock_context.md.Built from Jadpo main at aee2e8f.