Files
OmniRoute/@omniroute
diegosouzapw e8c52b06b6 test(plugin): wait for the v2 lazy-refresh tier instead of sleeping past it
`lazy refresh: [m1] then [m1,m2] reloads once; identical runs never reload`
waited for the plugin's asynchronous optional tier with a fixed `await sleep(5)`.
That is a race, not a wait: when the tier landed after the sleep, its reload was
still pending, so the next assertion counted it and read

    AssertionError: an identical run never reloads
    2 !== 1

The test file fails on every isolated run on the current release tip; it only
passed when the whole suite ran together and unrelated work happened to give the
tier enough slack.

Replaces both sleeps with a `settle()` helper that polls until the observed value
holds steady for three consecutive turns (5s ceiling), so the wait tracks the
work rather than the clock. The assertions are unchanged — this fixes how the
test waits, not what it checks.

The failure was invisible to the base-green sweep because
`.github/workflows/opencode-plugin-ci.yml` filters on
`paths: @omniroute/opencode-plugin*/**`, so the job only runs when the plugin
directories change and the nightly sweep never triggers it.

Isolated file: 6/6 runs green (was 0/6). Full v2 suite: 218/218. Build passes.
2026-09-07 16:19:50 -03:00
..
2026-06-13 17:27:40 -03:00