test(gui): isolate dashboard suite so GitHub CI gets past GUI tests - #19
Merged
Conversation
Shared-global bun test leaked happy-dom and React 19 window.event updates across files, which failed dozens of tests on GHA. Run isolated workers (cap 4), retry only failed files, and fire mutation timeouts from the test instead of a 30ms wall clock. Co-authored-by: pavelhov <pavelhov@users.noreply.github.com>
pavelhov
marked this pull request as ready for review
August 27, 2026 16:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What failed
GitHub
cidied atcd gui && bun test testsondevelopmentandmain(latestmainrun: 819 pass / 43 fail / 862 tests). Typecheck, privacy scan, and GUI lint were green, so the proxy Test suite step never started.Reproduced from the failing GHA log (not old line numbers). The failures were not random assertions: search/type/click paths did not update React state (
provider-catalog-searchstill showed the unfiltered Accounts list after typing; combo save never fired; notes blur never calledonUpdateProvider;#cwi-edit-savestayed disabled). Two tests also burned ~10–15s dumping huge happy-dom objects after the assertion missed.Locally on this branch, the same shared-global command was green (862 pass, ~42s). That is the GHA-only pattern already documented in
rail-hover-delete-dom.test.tsx: a late React 19dispatchSetStateafterafterEachrestoreswindowtoundefined,resolveUpdatePriorityreadswindow.event, and the throw poisons later files in the same process. Slower GHA makes the leak visible; a fast laptop often does not.A second, in-file race:
apikeys-mutation-timeoutaborted the hanging mutation on a real 30mssetTimeoutwhile the test flushed happy-dom timers. On a slow runner the abort already fired beforeexpect(backButton().disabled).toBe(true).Why
bun test testsloads every GUI file in one shared global. Happy-dom tests replaceglobalThis.document/window.window.event. happy-dom omits it; a late tick after teardown throws.--parallelimplies--isolate(fresh global per file). That is the same isolation idea as the proxy suite, without a full-rerun hack.What changed
gui/scripts/test.ts+guibun run test:--parallelcapped atmin(4, CPU), junit used only to name failed files, retry those files once on one worker. Never reruns the whole suite.gui/tests/preload.ts+gui/bunfig.toml: stubWindow.prototype.eventand leave a tinywindowafter each file so a stray React tick cannot throw.apikeys-mutation-timeout: the test fires the mockedAbortSignal.timeoutinstead of racing 30ms of wall clock.add-codex-account-oauth: drive poll ticks through a mockedsetIntervalinstead of waiting 7s.ci.ymland the post-merge cross-platform GUI step):cd gui && bun run test. Permissions remaincontents: read.Out of scope: macOS packaging, privacy-scan internals, request-decompress, Cursor OAuth, proxy-suite runner.
Verification
cd gui && bun test tests)cd gui && bun test tests --parallel=4cd gui && bun test tests --isolatecd gui && bun run test(CI command)bun run typecheckcd gui && bun run lintbun run privacy:scanGitHub
cion this PR is the remaining gate: it must get past GUI tests so the proxy suite actually runs.Do not merge to
main. Target isdevelopment.