You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(runtime-host): wait helpers poll on fixed tick budgets and can flake under load #4510
Following the same failure class as #4383 (fixed for packages/runtime in #4387): several packages/runtime-host test helpers poll for an asynchronous condition with a fixed count of macrotask ticks instead of a wall-clock deadline. The tick count is not a time budget — under a loaded CI runner the underlying work (turn settlement over UDS connections, agent-graph wake-run persistence, peer mesh roster propagation, provider request capture persistence) can span more ticks than the loop allows, so the helper gives up before the condition is genuinely false and the test reports a failure that cannot be distinguished from a real regression.
Inventory
Fixed-tick polling loops in packages/runtime-host/src/__tests__:
The in-memory setImmediate helpers (waitForPending in client-capability-admission-integration.test.ts, waitForGoalRun in goal-root-authority.test.ts) are intentionally out of scope: they poll in-memory facades where a tick budget is effectively unbounded.
Desired outcome
Convert the listed loops to the shared waitFor primitive from @maka/core/test-only/async-primitives with an explicit wall-clock deadline (5s) and a small poll interval, keeping each helper's failure message. Production behavior is unchanged; this is test-infrastructure only.
Automated disclosure: this issue was drafted by Claude at @qianzhu18's direction. @qianzhu18 remains the human contributor of record.
Heads-up: this is already implemented in #4511 (opened alongside this issue, covering the full inventory listed here). @ggbdpq sorry for the crossed wires — no remaining work on this one unless review surfaces gaps.
The inventory here was converted in #4566 (0356d4959): the listed helpers now use waitFor from @maka/core/test-only/async-primitives with explicit wall-clock deadlines, for example packages/runtime-host/src/__tests__/execution-model-composition.test.ts:2398 and :3152, and peer-mesh.test.ts:284. No fixed-tick loops from the list remain on main. Closing as done; #4511 covers the same work and can be closed with it.
Activity
ggbdpq commentedon Sep 2, 2026
take
qianzhu18 commentedon Sep 2, 2026
Heads-up: this is already implemented in #4511 (opened alongside this issue, covering the full inventory listed here). @ggbdpq sorry for the crossed wires — no remaining work on this one unless review surfaces gaps.
test(runtime-host): bound test wait helpers by wall-clock deadlines
test(runtime-host): bound test wait helpers by wall-clock deadlines
test(runtime-host): bound test wait helpers by wall-clock deadlines
test(runtime-host): give async wait helpers explicit time budgets
Astro-Han commentedon Sep 17, 2026
The inventory here was converted in #4566 (
0356d4959): the listed helpers now usewaitForfrom@maka/core/test-only/async-primitiveswith explicit wall-clock deadlines, for examplepackages/runtime-host/src/__tests__/execution-model-composition.test.ts:2398and:3152, andpeer-mesh.test.ts:284. No fixed-tick loops from the list remain onmain. Closing as done; #4511 covers the same work and can be closed with it.