Live window: resume, wait, halt

Let the target run, wait for a stop with a timeout, halt with confirmation.

since 0.3.0since 0.5.0

Methods

EntrySignatureAvailable sinceAPI 3
resumeresume(*, sync=True) -> dict0.3.0sync=False — 0.5.0
waitawait wait(*, timeout) -> dict0.5.0async only
haltawait halt(*, timeout) -> dict0.5.0async only

API 3 changes (0.5.0)

resume(sync=False), wait and halt are async def only; the timeout is mandatory. In def, resume() blocks until a stop.

Recommended

halt goes into finally: a wait timeout does not stop the target. The generation links a stop to its window.

@case("HW_WINDOW")
async def window(t):
    await t.reach("idle")
    started = t.resume(sync=False)
    try:
        waited = await t.wait(timeout=0.2)
        t.check("no stop yet", waited["outcome"], "timeout")
    finally:
        stopped = await t.halt(timeout=2)
    t.check("same window", stopped["generation"], started["generation"])
    t.check("memory readable", t.read("counter"), 3)

Avoid

Memory access while the target runs is refused (not_stopped). Without finally, a timeout leaves the target running.

await t.reach("idle")
t.resume(sync=False)
value = t.read("counter")      # refused: not_stopped
await t.wait(timeout=5)        # no finally/halt: a timeout leaves the target running

The fragments show refused or discouraged patterns, not a working recipe.

Fragments for a scenario body; firmware symbols are illustrative.

← NavigationAll groupsData →