Files
hermes-agent/apps
anhtahaylove 49fc4911a9 test(desktop): stop the unread-tile test timing out on loaded CI
`session-unread-tile.test.ts` intermittently fails CI with
`Test timed out in 15000ms` at the first case. It has hit at least three
independent branches, `main` included, so it is not tied to any one change.

The cost is module reconstruction. `beforeEach`/`afterEach` both call
`vi.resetModules()`, so each of the three cases re-imports six modules,
including `@/lib/chat-runtime` and the pane-tree store. Locally that is
~3.3s on median but the tail reaches 11.8s (3.6x the median) on a warm
machine; a loaded CI runner pushes that past the 15s budget. One observed
CI run passed at 14614ms, 386ms under the limit, which is the same test
sitting on the wrong side of the same boundary.

Drop `resetModules` and undo the per-test state explicitly instead:

- collect the `registry.register` disposers and run them in `afterEach`,
  matching what `session-states.test.ts` already does;
- reset `$layoutTree` and `$activeTreeGroup` at the top of `setup()`.
  `declareDefaultTree` only seeds the layout when it is empty, so without
  this the second case would adopt the first case's tree.

The test keeps its teeth: reverting the `$focusedStoredSessionId` change
from a5b5043 still fails exactly the same two cases as before this patch.

Slowest of 30 consecutive local runs goes from 11.84s to 3.70s, with the
median roughly unchanged.
2026-09-07 06:34:02 -07:00
..