Repository navigation
test(ui): await activity cache imports before teardown - #142282
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 8, 2026, 11:39 AM ET / 15:39 UTC. ClawSweeper reviewWhat this changesThe Activity page tests wait for pending lazy imports after disposing their owners and before clearing browser state. Merge readiness✅ Ready for maintainer review Keep open: the teardown repair remains useful on current main, follows existing fixture practice, and introduces no actionable correctness finding. This maintainer-labeled PR is also protected from automated closure. Priority: P3 Review scores
Verification
How this fits togetherControl UI Activity tests exercise Gateway connection changes that start asynchronous cache cleanup. Their teardown must finish module loading before Vitest destroys the simulated browser environment. flowchart LR
A[Activity lifecycle tests] --> B[Gateway connection changes]
B --> C[Lazy cache imports]
A --> D[Dispose test owners]
D --> E[Wait for imports]
C --> E
E --> F[Clear browser state]
F --> G[Destroy test environment]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +2. Total +2 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep asynchronous import cleanup inside the fixture lifecycle, preserving every existing assertion and the production lazy-loading boundary. Do we have a high-confidence way to reproduce the issue? No deterministic reproduction of the intermittent CI failure is established. Source confirms unjoined lazy imports during the exercised Gateway-change cases, and the PR reports observing pending work after original teardown. Is this the best way to solve the issue? Yes: Vitest's recursive import drain matches the demonstrated lifecycle gap and existing neighboring fixtures without adding fixed delays, weakening assertions, or changing production behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 37dbd0aac655. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* commit '04869ae4899ad0524c3287759798362b0d62fef8': (677 commits) fix(release): pin Kova census refresh (#142104) fix: doctor read-only database inspections time out on large agent databases (#142179) docs: align v2026.9.3 framing with release announcement (#142307) fix(ui): discover models when default-model pickers open (#142105) fix(ci): keep Docker upgrade seed baseline older than target (#142273) refactor(tests): reuse named OAuth credential fixtures (#142272) fix(ci): keep mobile release helpers out of source checks (#142115) chore(ui): refresh control ui locales (#142147) fix(active-memory): explain why recall was skipped (#138658) fix(media): preserve converted images with HEIC filenames (#142263) docs: add v2026.9.3 release notes (#142277) fix(ui): retire picker focus listeners together (#142258) fix(ui): keep menu hover colors consistent across themes (#142243) fix(release): keep changelog credits within verified history (#142261) fix: keep tool-finalizer placeholders private in message-only groups (#138645) perf(tui): carry prepared URL membership through rendering (#142262) test(ui): await activity cache imports before teardown (#142282) fix(qa): align auth and Workshop proofs with runtime contracts (#142280) feat(xai): use one curated catalog and concrete setup default (#142136) refactor(outbound): reuse prepared sendability facts (#142252) ...
What Problem This Solves
Resolves a problem where Activity page tests pass their assertions but fail the Node CI job when lazy cache imports continue after the jsdom environment is torn down. Main run 34241634465 reported four
EnvironmentTeardownErrorrejections after 5,650 passing tests.Why This Change Was Made
Gateway changes start asynchronous warm-boot cache invalidation. Stopping the test's Gateway does not join those lazy imports. The fixture now waits for Vitest's native recursive import drain after disposing its owners and before clearing browser state, matching the existing authentication and boot-record fixtures.
User Impact
More reliable CI, with all 21 Activity page cases and their assertions retained. No application behavior changes, new waits with fixed durations, extended deadlines, mocks, or production seams. Production delta: 0; test delta: +3/-1. The remaining import work is accounted for in teardown rather than leaking into the next environment.
Evidence
dynamicImportSettled()waits for resolving modules and their nested imports. Existinggateway-store.auth.test.tsandgateway-store.boot-record.test.tsuse the same cleanup boundary.Local timings had different cache/load states, so no controlled speedup is claimed. This repair prevents a passing test shard from failing during teardown and needing another run. Exact-head Linux CI will verify the final source before landing.