Test an ICP deadline by advancing the PocketIC clock

A timer test can exercise an hour of canister time without waiting an hour on the host. Advancing the clock and executing a round are separate test actions.

Establish observable boundaries

Start a PocketIC instance in manually controlled mode. Install the module, create one expiry and record a queryable count of expired records. Advance just short of the deadline and tick, then confirm the count is still zero. Cross the deadline and drive execution until the worker completes or the test's round budget is exhausted.

initial time = T
register deadline = T + 60 seconds
advance_time(61 seconds) → tick → inspect state

Check for a single effect

Tick several more rounds and check that the same record contributes exactly once. If expiry dispatches another canister call, observe its final callback too. The controlled test checks application scheduling semantics but cannot predict mainnet round latency.

Sources