Skip to content

build: balance CI test shards by measured spec duration - #53441

Merged
MarshallOfSound merged 2 commits into
mainfrom
build/weighted-spec-shards
Sep 3, 2026
Merged

MarshallOfSound merged 2 commits into
mainfrom
build/weighted-spec-shards

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member

Description of Change

script/split-tests.js assigned spec files to shards round-robin by it( count, so heavy files with few tests landed together: on macOS x64 the three darwin shards carried 29 / 13 / 7.5 test-minutes, and the 29-minute one is the last job to finish in most build.yml runs.

Expected x64 darwin shards with the seed weights: ~18 / 18 / 18 test-minutes instead of 29 / 13 / 7.5 (slowest shard ~23 min instead of 34 including setup). Windows and Linux shards even out too but weren't on the critical path.

Checklist

  • PR description included

Release Notes

Notes: none

@MarshallOfSound
MarshallOfSound marked this pull request as ready for review September 3, 2026 06:15
@MarshallOfSound MarshallOfSound added target/43-x-y PR should also be added to the "43-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. target/45-x-y PR should also be added to the "45-x-y" branch. no-backport and removed target/43-x-y PR should also be added to the "43-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. target/45-x-y PR should also be added to the "45-x-y" branch. labels Sep 3, 2026
split-tests.js assigned spec files round-robin by `it(` count, which put
api-browser-window-spec.ts and api-autoupdater-darwin-spec.ts on the same
macOS x64 shard (29 test-minutes) while its siblings got 13 and 7.5.

- split-tests.js packs files largest-first into the lightest shard using
  per-platform seconds from script/spec-weights.json; files without a
  weight get the median, and with no weights it falls back to `it(` count.
- The spec runner writes per-file wall time to spec/artifacts/
  spec-timings.json on CI (already uploaded with the test artifacts), and
  script/gen-spec-weights.js folds a downloaded set of those into
  spec-weights.json.
- Seed weights are derived from the test logs of build run 33716702873.
The setWindowOpenHandler zoomFactor test opens http://localhost at
zoomFactor 2.0 in the default session, which records a persisted per-host
zoom level for localhost. With the weighted shard split this spec now
shares a shard with api-web-contents-spec, whose 'cannot persist zoom
level after navigation with webFrame' test loads localhost in the default
session and expects a zoom level of 0.
@MarshallOfSound
MarshallOfSound force-pushed the build/weighted-spec-shards branch from 0422050 to dcd55ce Compare September 3, 2026 07:17

@jkleinsc jkleinsc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

It would be nice to have a scheduled job to update spec-weights.json.

@MarshallOfSound

Copy link
Copy Markdown
Member Author

It would be nice to have a scheduled job to update spec-weights.json.

Coming soon

@MarshallOfSound
MarshallOfSound merged commit 8baab86 into main Sep 3, 2026
75 of 76 checks passed
@release-clerk

release-clerk Bot commented Sep 3, 2026

Copy link
Copy Markdown

No Release Notes

@trop

trop Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

@MarshallOfSound has manually backported this PR to "45-x-y", please check out #53561

@trop

trop Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

@MarshallOfSound has manually backported this PR to "44-x-y", please check out #53562

@trop

trop Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

@MarshallOfSound has manually backported this PR to "43-x-y", please check out #53563

@trop

trop Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

@MarshallOfSound has manually backported this PR to "42-x-y", please check out #53564

@trop trop Bot added the in-flight/42-x-y label Sep 5, 2026
MarshallOfSound added a commit that referenced this pull request Sep 5, 2026
* build: balance CI test shards by measured spec duration

split-tests.js assigned spec files round-robin by `it(` count, which put
api-browser-window-spec.ts and api-autoupdater-darwin-spec.ts on the same
macOS x64 shard (29 test-minutes) while its siblings got 13 and 7.5.

- split-tests.js packs files largest-first into the lightest shard using
  per-platform seconds from script/spec-weights.json; files without a
  weight get the median, and with no weights it falls back to `it(` count.
- The spec runner writes per-file wall time to spec/artifacts/
  spec-timings.json on CI (already uploaded with the test artifacts), and
  script/gen-spec-weights.js folds a downloaded set of those into
  spec-weights.json.
- Seed weights are derived from the test logs of build run 33716702873.

* test: isolate window.open zoomFactor spec in its own partition

The setWindowOpenHandler zoomFactor test opens http://localhost at
zoomFactor 2.0 in the default session, which records a persisted per-host
zoom level for localhost. With the weighted shard split this spec now
shares a shard with api-web-contents-spec, whose 'cannot persist zoom
level after navigation with webFrame' test loads localhost in the default
session and expects a zoom level of 0.

(cherry picked from commit 8baab86)
MarshallOfSound added a commit that referenced this pull request Sep 5, 2026
* build: balance CI test shards by measured spec duration

split-tests.js assigned spec files round-robin by `it(` count, which put
api-browser-window-spec.ts and api-autoupdater-darwin-spec.ts on the same
macOS x64 shard (29 test-minutes) while its siblings got 13 and 7.5.

- split-tests.js packs files largest-first into the lightest shard using
  per-platform seconds from script/spec-weights.json; files without a
  weight get the median, and with no weights it falls back to `it(` count.
- The spec runner writes per-file wall time to spec/artifacts/
  spec-timings.json on CI (already uploaded with the test artifacts), and
  script/gen-spec-weights.js folds a downloaded set of those into
  spec-weights.json.
- Seed weights are derived from the test logs of build run 33716702873.

* test: isolate window.open zoomFactor spec in its own partition

The setWindowOpenHandler zoomFactor test opens http://localhost at
zoomFactor 2.0 in the default session, which records a persisted per-host
zoom level for localhost. With the weighted shard split this spec now
shares a shard with api-web-contents-spec, whose 'cannot persist zoom
level after navigation with webFrame' test loads localhost in the default
session and expects a zoom level of 0.

(cherry picked from commit 8baab86)
MarshallOfSound added a commit that referenced this pull request Sep 5, 2026
* build: balance CI test shards by measured spec duration

split-tests.js assigned spec files round-robin by `it(` count, which put
api-browser-window-spec.ts and api-autoupdater-darwin-spec.ts on the same
macOS x64 shard (29 test-minutes) while its siblings got 13 and 7.5.

- split-tests.js packs files largest-first into the lightest shard using
  per-platform seconds from script/spec-weights.json; files without a
  weight get the median, and with no weights it falls back to `it(` count.
- The spec runner writes per-file wall time to spec/artifacts/
  spec-timings.json on CI (already uploaded with the test artifacts), and
  script/gen-spec-weights.js folds a downloaded set of those into
  spec-weights.json.
- Seed weights are derived from the test logs of build run 33716702873.

* test: isolate window.open zoomFactor spec in its own partition

The setWindowOpenHandler zoomFactor test opens http://localhost at
zoomFactor 2.0 in the default session, which records a persisted per-host
zoom level for localhost. With the weighted shard split this spec now
shares a shard with api-web-contents-spec, whose 'cannot persist zoom
level after navigation with webFrame' test loads localhost in the default
session and expects a zoom level of 0.

(cherry picked from commit 8baab86)
MarshallOfSound added a commit that referenced this pull request Sep 5, 2026
* build: balance CI test shards by measured spec duration

split-tests.js assigned spec files round-robin by `it(` count, which put
api-browser-window-spec.ts and api-autoupdater-darwin-spec.ts on the same
macOS x64 shard (29 test-minutes) while its siblings got 13 and 7.5.

- split-tests.js packs files largest-first into the lightest shard using
  per-platform seconds from script/spec-weights.json; files without a
  weight get the median, and with no weights it falls back to `it(` count.
- The spec runner writes per-file wall time to spec/artifacts/
  spec-timings.json on CI (already uploaded with the test artifacts), and
  script/gen-spec-weights.js folds a downloaded set of those into
  spec-weights.json.
- Seed weights are derived from the test logs of build run 33716702873.

* test: isolate window.open zoomFactor spec in its own partition

The setWindowOpenHandler zoomFactor test opens http://localhost at
zoomFactor 2.0 in the default session, which records a persisted per-host
zoom level for localhost. With the weighted shard split this spec now
shares a shard with api-web-contents-spec, whose 'cannot persist zoom
level after navigation with webFrame' test loads localhost in the default
session and expects a zoom level of 0.

(cherry picked from commit 8baab86)
codebytere pushed a commit that referenced this pull request Sep 5, 2026
build: balance CI test shards by measured spec duration (#53441)

* build: balance CI test shards by measured spec duration

split-tests.js assigned spec files round-robin by `it(` count, which put
api-browser-window-spec.ts and api-autoupdater-darwin-spec.ts on the same
macOS x64 shard (29 test-minutes) while its siblings got 13 and 7.5.

- split-tests.js packs files largest-first into the lightest shard using
  per-platform seconds from script/spec-weights.json; files without a
  weight get the median, and with no weights it falls back to `it(` count.
- The spec runner writes per-file wall time to spec/artifacts/
  spec-timings.json on CI (already uploaded with the test artifacts), and
  script/gen-spec-weights.js folds a downloaded set of those into
  spec-weights.json.
- Seed weights are derived from the test logs of build run 33716702873.

* test: isolate window.open zoomFactor spec in its own partition

The setWindowOpenHandler zoomFactor test opens http://localhost at
zoomFactor 2.0 in the default session, which records a persisted per-host
zoom level for localhost. With the weighted shard split this spec now
shares a shard with api-web-contents-spec, whose 'cannot persist zoom
level after navigation with webFrame' test loads localhost in the default
session and expects a zoom level of 0.

(cherry picked from commit 8baab86)
codebytere pushed a commit that referenced this pull request Sep 5, 2026
build: balance CI test shards by measured spec duration (#53441)

* build: balance CI test shards by measured spec duration

split-tests.js assigned spec files round-robin by `it(` count, which put
api-browser-window-spec.ts and api-autoupdater-darwin-spec.ts on the same
macOS x64 shard (29 test-minutes) while its siblings got 13 and 7.5.

- split-tests.js packs files largest-first into the lightest shard using
  per-platform seconds from script/spec-weights.json; files without a
  weight get the median, and with no weights it falls back to `it(` count.
- The spec runner writes per-file wall time to spec/artifacts/
  spec-timings.json on CI (already uploaded with the test artifacts), and
  script/gen-spec-weights.js folds a downloaded set of those into
  spec-weights.json.
- Seed weights are derived from the test logs of build run 33716702873.

* test: isolate window.open zoomFactor spec in its own partition

The setWindowOpenHandler zoomFactor test opens http://localhost at
zoomFactor 2.0 in the default session, which records a persisted per-host
zoom level for localhost. With the weighted shard split this spec now
shares a shard with api-web-contents-spec, whose 'cannot persist zoom
level after navigation with webFrame' test loads localhost in the default
session and expects a zoom level of 0.

(cherry picked from commit 8baab86)
codebytere pushed a commit that referenced this pull request Sep 5, 2026
build: balance CI test shards by measured spec duration (#53441)

* build: balance CI test shards by measured spec duration

split-tests.js assigned spec files round-robin by `it(` count, which put
api-browser-window-spec.ts and api-autoupdater-darwin-spec.ts on the same
macOS x64 shard (29 test-minutes) while its siblings got 13 and 7.5.

- split-tests.js packs files largest-first into the lightest shard using
  per-platform seconds from script/spec-weights.json; files without a
  weight get the median, and with no weights it falls back to `it(` count.
- The spec runner writes per-file wall time to spec/artifacts/
  spec-timings.json on CI (already uploaded with the test artifacts), and
  script/gen-spec-weights.js folds a downloaded set of those into
  spec-weights.json.
- Seed weights are derived from the test logs of build run 33716702873.

* test: isolate window.open zoomFactor spec in its own partition

The setWindowOpenHandler zoomFactor test opens http://localhost at
zoomFactor 2.0 in the default session, which records a persisted per-host
zoom level for localhost. With the weighted shard split this spec now
shares a shard with api-web-contents-spec, whose 'cannot persist zoom
level after navigation with webFrame' test loads localhost in the default
session and expects a zoom level of 0.

(cherry picked from commit 8baab86)
codebytere pushed a commit that referenced this pull request Sep 5, 2026
build: balance CI test shards by measured spec duration (#53441)

* build: balance CI test shards by measured spec duration

split-tests.js assigned spec files round-robin by `it(` count, which put
api-browser-window-spec.ts and api-autoupdater-darwin-spec.ts on the same
macOS x64 shard (29 test-minutes) while its siblings got 13 and 7.5.

- split-tests.js packs files largest-first into the lightest shard using
  per-platform seconds from script/spec-weights.json; files without a
  weight get the median, and with no weights it falls back to `it(` count.
- The spec runner writes per-file wall time to spec/artifacts/
  spec-timings.json on CI (already uploaded with the test artifacts), and
  script/gen-spec-weights.js folds a downloaded set of those into
  spec-weights.json.
- Seed weights are derived from the test logs of build run 33716702873.

* test: isolate window.open zoomFactor spec in its own partition

The setWindowOpenHandler zoomFactor test opens http://localhost at
zoomFactor 2.0 in the default session, which records a persisted per-host
zoom level for localhost. With the weighted shard split this spec now
shares a shard with api-web-contents-spec, whose 'cannot persist zoom
level after navigation with webFrame' test loads localhost in the default
session and expects a zoom level of 0.

(cherry picked from commit 8baab86)
@trop trop Bot added merged/42-x-y PR was merged to the "42-x-y" branch. merged/43-x-y PR was merged to the "43-x-y" branch. merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. and removed in-flight/42-x-y in-flight/43-x-y in-flight/44-x-y in-flight/45-x-y labels Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

46-x-y merged/42-x-y PR was merged to the "42-x-y" branch. merged/43-x-y PR was merged to the "43-x-y" branch. merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. no-backport semver/none

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants