opencode/packages/widget/test/limits.ts
OpenCode Agent 9b94a46b77 test(core): widget tests don't depend on wall-clock limits; spec the slow-shader stop
Tests that don't prove the 250 ms step timeout or the 50 ms live slice run with limits no test
comes near (test/limits.ts); those that prove them set them. The post-rate test waits until all
30 renders are posted (a send marks it) instead of assuming the loop ends within a few turns.
20 full runs under load, all green.

widgets.md: a host never submits a shader frame while the previous one draws; one still
unfinished 50 ms after its submit three frames in a row stops on its last frame, a client error
'the shader took over 50 ms a frame, three frames in a row'.
2026-11-23 05:42:40 +00:00

7 lines
460 B
TypeScript

// Wall-clock limits for tests. The step timeout and the live slice guard real hosts, and the tests that prove them set
// them; elsewhere a loaded machine mustn't fail a test, so runs get limits no test comes near.
export const UNHURRIED_MS = 60_000
/** Step options without the 250 ms step timeout. */
export const STEP = { timeoutMs: UNHURRIED_MS } as const
/** Live options without the 50 ms slice. */
export const LIVE = { busyMs: UNHURRIED_MS } as const