Repository navigation
test: run the spec suite with vitest - #54264
Merged
Merged
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Member
Author
|
@claude review |
MarshallOfSound
force-pushed
the
claude/project-thread-a1ddk9-vitest
branch
2 times, most recently
from
September 24, 2026 00:53
518f9f2 to
8dded97
Compare
MarshallOfSound
force-pushed
the
claude/project-thread-a1ddk9
branch
from
September 24, 2026 01:37
b21b648 to
50e806f
Compare
MarshallOfSound
force-pushed
the
claude/project-thread-a1ddk9-vitest
branch
from
September 24, 2026 01:37
8dded97 to
6e64e49
Compare
MarshallOfSound
force-pushed
the
claude/project-thread-a1ddk9
branch
from
September 24, 2026 03:20
50e806f to
0eaffe5
Compare
MarshallOfSound
force-pushed
the
claude/project-thread-a1ddk9-vitest
branch
3 times, most recently
from
September 24, 2026 04:07
17ff6c7 to
ad8f2d1
Compare
MarshallOfSound
force-pushed
the
claude/project-thread-a1ddk9
branch
from
September 24, 2026 05:14
0eaffe5 to
5f101b5
Compare
MarshallOfSound
force-pushed
the
claude/project-thread-a1ddk9-vitest
branch
2 times, most recently
from
September 24, 2026 06:38
31c307e to
85f8bba
Compare
MarshallOfSound
force-pushed
the
claude/project-thread-a1ddk9-vitest
branch
2 times, most recently
from
September 24, 2026 07:03
f93e99b to
6ecc14e
Compare
MarshallOfSound
force-pushed
the
claude/project-thread-a1ddk9-vitest
branch
from
September 24, 2026 07:26
6ecc14e to
44b4f95
Compare
Merged
6 tasks done
MarshallOfSound
force-pushed
the
claude/project-thread-a1ddk9-vitest
branch
from
September 24, 2026 11:01
7e4a2c1 to
f668b96
Compare
MarshallOfSound
changed the base branch from
main
to
fix/settle-promise-outside-task
September 24, 2026 11:01
MarshallOfSound
enabled auto-merge (squash)
September 24, 2026 19:07
MarshallOfSound
force-pushed
the
claude/project-thread-a1ddk9-vitest
branch
from
September 24, 2026 21:12
f668b96 to
61a1441
Compare
Replace the in-process mocha runner with vitest driving a pool of Electron processes. - spec/vitest/electron-pool.ts is a vitest pool whose workers are 'electron spec/ --vitest-worker' browser processes talking to the CLI over a Node IPC channel (JSON, see ipc-serialization.ts, because the host Node cannot read Electron's newer V8 wire format). - spec/index.js keeps the pre-ready process setup and then hands the main process to vitest's worker runtime (spec/vitest/worker.ts). experimental.viteModuleRunner is off, so spec files are imported by Electron's own Node exactly as before (native ESM, type stripping, no Vite transform). - spec/vitest/mocha-compat.ts provides mocha's BDD globals (describe/it/ before/after, this.timeout()/this.skip(), done callbacks, resettable timeouts, hooks in declaration order, a macrotask between runnables) on top of vitest, so the spec files run unchanged. - Two projects run in sequence: everything not tagged 'serial' across several workers, then the 'serial' suites one file at a time. - script/spec-runner.js translates --files/-g into vitest filters, wraps the CLI in dbus_mock.py on Linux and reruns failures from vitest's JUnit report; leftover Electron processes are killed once per run (global-setup.js) and per worker process group. - spec-timings.json for shard balancing comes from timings-reporter.ts; mocha, its reporters and ELECTRON_FORCE_TEST_SUITE_EXIT are gone.
app.isActive(), app.hide()/show() and the dock are machine-wide state, so these suites cannot share the screen with other spec processes. The isActive spec also assumed the process starts out inactive, which a freshly launched worker on the CI hosts is not; hide first in that case.
MarshallOfSound
force-pushed
the
claude/project-thread-a1ddk9-vitest
branch
from
September 25, 2026 22:03
5fd0fad to
4d06682
Compare
|
No Release Notes |
4 tasks done
4 of 6 tasks
This was referenced Oct 14, 2026
MarshallOfSound
pushed a commit
that referenced
this pull request
Oct 15, 2026
…ws or hangs (#54950) * test: run every afterEach hook and deferred cleanup when one throws vitest runs a test's afterEach hooks one at a time and stops at the first one that throws, skipping the rest of that suite's hooks and every enclosing suite's. The spec runner adds defer()-ed cleanup as the first afterEach hook of every suite, so a single failing cleanup also skipped hooks such as protocol.unhandle() and closeWindow(). The handler and the window then leaked, and on CI the next try failed in beforeEach with "Failed to register protocol: no-cors". The runner now catches what each afterEach hook throws, defer()-ed cleanup included, lets the remaining hooks run, and rethrows the errors from an onTestFinished callback once all of them have finished. The test still fails, and vitest reports each error separately. The order of hooks and cleanups is unchanged. A new spec covers failing hooks and cleanups in nested suites. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test: give each deferred cleanup the hook timeout defer()-ed cleanup has had no timeout since the move to vitest (#54264). The mocha shim registered it with vitest's hook timeout set to 0, which vitest treats as no timeout, and the runner from #54439 puts it into each suite's afterEach hooks directly, not through afterEach(). So a cleanup that never settles, such as a closeWindow() whose window never emits 'closed', hangs the spec file until the CI job times out instead of failing one test. Each defer()-ed cleanup now gets the hook timeout, as an afterEach hook would. A cleanup that times out fails the test with an error whose stack points at its defer() call, and the cleanups registered before it and the remaining afterEach hooks still run. The timeout is read when the cleanup runs, so vi.setConfig() applies; the new spec uses that to keep its slow-cleanup case fast. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
MarshallOfSound
pushed a commit
that referenced
this pull request
Oct 15, 2026
…ws or hangs (#54997) * test: run every afterEach hook and deferred cleanup when one throws vitest runs a test's afterEach hooks one at a time and stops at the first one that throws, skipping the rest of that suite's hooks and every enclosing suite's. The spec runner adds defer()-ed cleanup as the first afterEach hook of every suite, so a single failing cleanup also skipped hooks such as protocol.unhandle() and closeWindow(). The handler and the window then leaked, and on CI the next try failed in beforeEach with "Failed to register protocol: no-cors". The runner now catches what each afterEach hook throws, defer()-ed cleanup included, lets the remaining hooks run, and rethrows the errors from an onTestFinished callback once all of them have finished. The test still fails, and vitest reports each error separately. The order of hooks and cleanups is unchanged. A new spec covers failing hooks and cleanups in nested suites. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-authored-by: Charles Kerr <[email protected]> * test: give each deferred cleanup the hook timeout defer()-ed cleanup has had no timeout since the move to vitest (#54264). The mocha shim registered it with vitest's hook timeout set to 0, which vitest treats as no timeout, and the runner from #54439 puts it into each suite's afterEach hooks directly, not through afterEach(). So a cleanup that never settles, such as a closeWindow() whose window never emits 'closed', hangs the spec file until the CI job times out instead of failing one test. Each defer()-ed cleanup now gets the hook timeout, as an afterEach hook would. A cleanup that times out fails the test with an error whose stack points at its defer() call, and the cleanups registered before it and the remaining afterEach hooks still run. The timeout is read when the cleanup runs, so vi.setConfig() applies; the new spec uses that to keep its slow-cleanup case fast. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-authored-by: Charles Kerr <[email protected]> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <[email protected]>
MarshallOfSound
pushed a commit
that referenced
this pull request
Oct 15, 2026
…ws or hangs (#54994) * test: run every afterEach hook and deferred cleanup when one throws vitest runs a test's afterEach hooks one at a time and stops at the first one that throws, skipping the rest of that suite's hooks and every enclosing suite's. The spec runner adds defer()-ed cleanup as the first afterEach hook of every suite, so a single failing cleanup also skipped hooks such as protocol.unhandle() and closeWindow(). The handler and the window then leaked, and on CI the next try failed in beforeEach with "Failed to register protocol: no-cors". The runner now catches what each afterEach hook throws, defer()-ed cleanup included, lets the remaining hooks run, and rethrows the errors from an onTestFinished callback once all of them have finished. The test still fails, and vitest reports each error separately. The order of hooks and cleanups is unchanged. A new spec covers failing hooks and cleanups in nested suites. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-authored-by: Charles Kerr <[email protected]> * test: give each deferred cleanup the hook timeout defer()-ed cleanup has had no timeout since the move to vitest (#54264). The mocha shim registered it with vitest's hook timeout set to 0, which vitest treats as no timeout, and the runner from #54439 puts it into each suite's afterEach hooks directly, not through afterEach(). So a cleanup that never settles, such as a closeWindow() whose window never emits 'closed', hangs the spec file until the CI job times out instead of failing one test. Each defer()-ed cleanup now gets the hook timeout, as an afterEach hook would. A cleanup that times out fails the test with an error whose stack points at its defer() call, and the cleanups registered before it and the remaining afterEach hooks still run. The timeout is read when the cleanup runs, so vi.setConfig() applies; the new spec uses that to keep its slow-cleanup case fast. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-authored-by: Charles Kerr <[email protected]> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <[email protected]>
MarshallOfSound
pushed a commit
that referenced
this pull request
Oct 15, 2026
…ws or hangs (#54995) * test: run every afterEach hook and deferred cleanup when one throws vitest runs a test's afterEach hooks one at a time and stops at the first one that throws, skipping the rest of that suite's hooks and every enclosing suite's. The spec runner adds defer()-ed cleanup as the first afterEach hook of every suite, so a single failing cleanup also skipped hooks such as protocol.unhandle() and closeWindow(). The handler and the window then leaked, and on CI the next try failed in beforeEach with "Failed to register protocol: no-cors". The runner now catches what each afterEach hook throws, defer()-ed cleanup included, lets the remaining hooks run, and rethrows the errors from an onTestFinished callback once all of them have finished. The test still fails, and vitest reports each error separately. The order of hooks and cleanups is unchanged. A new spec covers failing hooks and cleanups in nested suites. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-authored-by: Charles Kerr <[email protected]> * test: give each deferred cleanup the hook timeout defer()-ed cleanup has had no timeout since the move to vitest (#54264). The mocha shim registered it with vitest's hook timeout set to 0, which vitest treats as no timeout, and the runner from #54439 puts it into each suite's afterEach hooks directly, not through afterEach(). So a cleanup that never settles, such as a closeWindow() whose window never emits 'closed', hangs the spec file until the CI job times out instead of failing one test. Each defer()-ed cleanup now gets the hook timeout, as an afterEach hook would. A cleanup that times out fails the test with an error whose stack points at its defer() call, and the cleanups registered before it and the remaining afterEach hooks still run. The timeout is read when the cleanup runs, so vi.setConfig() applies; the new spec uses that to keep its slow-cleanup case fast. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-authored-by: Charles Kerr <[email protected]> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <[email protected]>
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.
Description of Change
Runs the spec suite with vitest instead of the in-process mocha runner. The vitest CLI starts a pool of
electron spec/processes, gives each one spec file at a time, and runs the suites taggedserialon their own afterwards. Spec files are unchanged: they are still loaded by Electron's own Node.js (no Vite transform) and keep mocha'sdescribe/it/before/after/this.timeout()interface via a small compatibility layer.npm test,--files,-g, the JUnit report, the CI rerun step andspec-timings.jsonwork as before; mocha and its reporters are removed."Run Electron Tests" step, this PR vs #54261 (same base, mocha):
The pool sizes itself to about a third of the runner's CPUs (2 on the 4-core Linux/Windows hosts, 4 on macOS x64), so the gain on CI is bounded by the runners; on a 64-core machine the whole Linux suite runs in under 6 minutes against 20.
The asan numbers need #54296 (now on main): before it
api-clipboard.spec.tswaited for an unrelated main-loop wake on every read and the first asan shard ran past the 60 min job limit.Checklist
npm testpassesRelease Notes
Notes: none