From e256260ff4910e6f60f44cc2e031eca1d84fefbe Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 1 Aug 2026 20:36:12 +0300 Subject: [PATCH] ci: shard the CKEditor suite so coverage data cannot exhaust the browser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two runs of this branch died at the same point: 100 of 121 spec files completed, then the browser session either dropped mid-run or stopped responding until the step timed out. Chromedriver and Chrome are correctly paired (150.0.7871.124 / .128), and the DOM is clean at the end of every file — no editors, math fields, balloons or previews are left behind, so the tests themselves are not leaking. What accumulates is v8 coverage data. Browser mode keeps one page for the whole run, and coverage collects for every script loaded into it. Measured locally over the same file order: file without --coverage with --coverage 20 218 MB 235 MB 60 291 MB 498 MB 100 236 MB 847 MB 106 - 873 MB (peak) Without coverage the heap sawtooths and GC keeps up. With it, the heap climbs to ~3.6x by the 100th file — exactly where CI gives out. Locally there is enough headroom to survive it; a runner has less. Run the suite as two shards of ~60 files, which peaks around 500MB, and merge the blob reports afterwards. Thresholds are zeroed for the shard runs (each only exercises half the tree, so they would fail on files the other shard covers) and enforced on the merged report, which reproduces the single-run numbers exactly and still writes the JUnit file Codecov uploads. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/dev.yml | 13 ++++++++++++- .gitignore | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 8a519800be..98ee0e1fb9 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -147,7 +147,18 @@ jobs: "$CHROMEDRIVER_PATH" --version || echo "could not read the chromedriver version" (google-chrome --version || chromium --version || chromium-browser --version) 2>/dev/null \ || echo "could not read the Chrome version" - pnpm run --filter=ckeditor5 test --coverage + # Browser mode keeps one page for the whole run, and v8 coverage data accumulates in it: + # measured locally, the heap reaches ~850MB by the 100th spec file with --coverage against + # ~240MB without it. That is where a CI runner's renderer gives out — the session either + # drops mid-run or stops responding. Run the suite in two shards (~60 files each, peaking + # around 500MB) and merge the blob reports afterwards, so the 100% gate is still evaluated + # over the whole suite rather than per shard. + SHARD_ARGS="--reporter=blob --coverage \ + --coverage.thresholds.lines=0 --coverage.thresholds.functions=0 \ + --coverage.thresholds.branches=0 --coverage.thresholds.statements=0" + pnpm run --filter=ckeditor5 test --shard=1/2 $SHARD_ARGS + pnpm run --filter=ckeditor5 test --shard=2/2 $SHARD_ARGS + pnpm run --filter=ckeditor5 test --mergeReports --coverage - name: Upload ckeditor5 coverage to Codecov uses: codecov/codecov-action@v7 diff --git a/.gitignore b/.gitignore index 40b35c366a..23d707912e 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,7 @@ Thumbs.db vite.config.*.timestamp* vitest.config.*.timestamp* test-output +.vitest-reports __screenshots__ .vitest-attachments