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
Flaky (local-only): route-types-hmr "recovery: helper-file fix after broken-import error re-runs discovery" fails about half the runs and leaves the test-app modified #1040
recovery: helper-file fix after broken-import error re-runs discovery (packages/rangojs-router/e2e/route-types-hmr.test.ts:809) fails in about half the runs of pnpm --filter @rangojs/router test:hmr-routes-local, and a failed run leaves the test-app's source modified. CI skips this suite, so it only shows locally.
Numbers
main plus one docs commit (9938350d): failed in 2 of 4 runs; the other 2 were 21 passed.
on the generated route names file. The runs did not record which of the test's two assertions of that form failed: the sanity check before the edit, or the check that the file is still at last-good while discovery is failing.
A failed run reports "1 failed, 1 flaky, 19 passed": the serial retry then fails in beforeAll.
It leaves the tree dirty
After a failure e2e/test-app/src/urls/blog.handlers.tsx keeps the syntax error the test appended (// recovery-test syntax error and }}}}) and has to be restored with git checkout. The retry then fails in beforeAll, which refuses to start on a dirty tree.
Read from the test, not traced: the test's own finally restores only blog.tsx, and it sits after the two assertions that can fail. The other files are restored by afterEach (line 164), one at a time, waiting for the dev server to apply each. With discovery stuck in its failed state that wait fails on the first file (blog.tsx), so the loop never reaches blog.handlers.tsx.
Hypothesis, not verified
Step 1 writes blog.tsx (a new route) and then blog.handlers.tsx (the syntax error) as two fs.writeFile calls and expects one debounced rediscovery that throws. If the watcher fires between the two writes, a rediscovery succeeds with the new route first, the generated file already holds blog.recovered, and the "still at last-good" assertion fails.
Expected
The test passes reliably: break the helper file first and wait for the failure marker before adding the route, or assert on the failure path only.
A failure restores every file: write all baselines first, then wait.
Activity
test(router): make the HMR recovery test deterministic and its cleanu…