Scan-cycle observability¶
Test cases verifying the scan-cycle observability sub-feature (Scan-cycle observability (FEAT_0021)). This area also carries the witnesses for the absolute-grid cyclic dispatch (Absolute-grid cyclic dispat... (REQ_0268)), the skip-signal re-anchoring (Per-task skipped-slot count (REQ_0840)), the EINTR-immune run loop (Run-loop immunity to spurio... (REQ_0269)), and the tight dispatch-thread timer slack (Tight dispatch-thread timer... (REQ_0274)), since they share the per-cycle telemetry harness.
Goal. Confirm the Fixed-bucket histogram for ... (ADR_0060) histogram returns p50, p95,
p99 estimates within the documented relative-error bound
( Fixture. A standalone unit test in
Steps.
Expected outcome. All six assertions hold (3 quantiles × 2 distributions). Lives under
|
Goal. Confirm the refined sub-octave histogram returns p50, p95, p99 within ≤ 1 % relative error at bucket centroids on a known reference distribution. Fixture / steps. As Histogram percentile accuracy (TEST_0190), but assert relative error
≤ 1 % rather than Status note. Remains |
Goal. A period violation produces the exact max-jitter readout. Fixture. Executor with one cyclic task whose telemetry clock is an
injected Steps.
Expected outcome. Max jitter equals the injected overshoot to the nanosecond. Rationale for the mock clock. Deriving jitter from a real
Lives under
|
Goal. Fixture. Executor with one cyclic task at 10 ms period. Steps.
Expected outcome. All three assertions hold. Lives under
|
Goal. Each completed scan cycle delivers exactly one
Fixture. Executor with two cyclic tasks (5 ms and 7 ms scan
periods) and a custom Steps.
Expected outcome. Push and pull paths report consistent aggregates. Lives under
|
Goal. The per-sample telemetry update path performs zero heap allocations under steady state. Fixture. Reuses the Steps.
Negative case. Replace the no-op task body with a
Expected outcome. Steady-state telemetry update performs zero heap allocations. Lives under
|
Goal. The Fixture. Executor ( Steps.
Expected outcome. The exact extremes are retained to the
nanosecond, distinct from the bucket-quantised percentiles. The earlier
real-sleep version could only bound Lives under
|
Test Case: Deadline lateness — drift accumulates, coalesced pair heals, offsets stay honest TEST_0850
|
Goal. The scan-count-anchored lateness of Per-task deadline lateness (REQ_0106)
(1) accumulates a steady signed offset past one period (not a
phase-within-period readout), (2) reports the issue-#46 coalesced
catch-up pair as a single transient positive spike with no
fabricated negative lateness and no permanent step, (3) absent a
dispatcher skip signal, reports a whole missed period as an honest
persistent offset, and (4) anchors each task’s grid at its
own first dispatch (in Fixture. Executor ( Steps — accumulation.
Steps — coalesced catch-up pair (the #46 regression).
Steps — missed period without a skip signal.
Steps — per-task epoch.
All four live in
|
Goal. The per-task Fixture. Executor ( Steps.
Expected outcome. The Lives under
|
Goal. The pure Fixture. Deterministic unit tests over Steps.
Expected outcome. The grid never slides under per-cycle lateness, a transient stall costs bounded slots rather than a permanent phase offset, and multi-cadence grids share the one scheduling epoch — the structural guarantee behind the bounded lateness of Absolute-grid cyclic dispat... (REQ_0268). |
Goal. The Absolute-grid cyclic dispat... (REQ_0268) skip-realign reaches telemetry as
Layer 1 — ``GridTimer`` unit (pure, exact).
Layer 2 — executor integration (Linux-only, real clocks, loose bounds).
Layer 2 runs on Linux only — the production Layer 1 lives in |
Goal. In Fixture. Linux-gated (the scripted call sequence is only
deterministic on the production Steps.
Lives in |
Goal. A storm of handled signals interrupting the blocking wait
neither terminates Fixture. Unix-gated: a no-op Steps.
Lives in |
Goal. The dispatch thread’s effective timer slack is 1 µs, not
the kernel’s 50 µs Fixture. Linux-gated: Steps.
Lives in
|