# `type.test_clock_context`

The clock is moved outside a test.

Area 13, [Testing](../topics/testing.md); not declinable; the next step is usually the agent's.

Application code cannot move the clock:

```jadpo
type ShiftEnd = Instant {}

action end_shift() -> ShiftEnd {
    clock.advance(5m)
    return ShiftEnd(clock.now)
}
```

```text
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

check failed: 1 error, 1 file
```
