Visitar URL original
ci: run test262 tests in 2 chunks by JLHwung · Pull Request #18503 · babel/babel · GitHub
Skip to content

ci: run test262 tests in 2 chunks - #18503

Open
JLHwung wants to merge 3 commits into
babel:mainfrom
JLHwung:improve-test262-test-run
Open

JLHwung wants to merge 3 commits into
babel:mainfrom
JLHwung:improve-test262-test-run

Conversation

@JLHwung

@JLHwung JLHwung commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor
Q                       A
Fixed Issues?
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
Need backport? 7.x
License MIT

With the help of test262 runner cache, a cache run has been decreased from ~6:37 (Chunk 1 on 3b8f924724a267513c58458251a8df4162668c95) to ~45 seconds (Chunk 1 on 0750fe6a02357e53fa93e06f383a2419be6abef0), so the workflow overhead is more significant and now we can run the cached test in 2 jobs, with the current GH workflow overhead, my estimation is that each test262 job will take ~4 min, roughly the same as how much we spent on the lint job.

Reducing the job number will produce a new problem: If there is update in the test262-runner (mostly from dependabot), the cache will be invalidated and uncached test262 job in 2 chunk will take more than half an hour. So we add a new workflow, which split into 16 chunks to burst the cache. This workflow can be dispatched manually or triggered by the babel-test262-runner workflow.

Note: In this PR the test262 job is slow because they are still using the cache for the 8-chunk settings, so 75% of the chunk tests are not cached in this PR. Once this PR gets merged and the cache is burst, the new job runtime will be improved.

@pkg-pr-new

pkg-pr-new Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

commit: 548b73f

@nicolo-ribaudo

Copy link
Copy Markdown
Member

Reducing the job number will produce a new problem: If there is update in the test262-runner (mostly from dependabot), the cache will be invalidated and uncached test262 job in 2 chunk will take more than half an hour

Most of the test262 updates only change a few tests. Would it be doable to use git to see the diff between them, and only invalidate the affected tests? While still invalidating everything for harness changes.

@liuxingbaoyu

Copy link
Copy Markdown
Member

Most of the test262 updates only change a few tests. Would it be doable to use git to see the diff between them, and only invalidate the affected tests? While still invalidating everything for harness changes.

Could he be referring to the core-js version?

@nicolo-ribaudo nicolo-ribaudo 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.

Looking at this PR's CI, even without the cache the two jobs completed in about 15 minutes.

I think it's fine, and we don't need the extra workflow. In practice they will take 15 minutes once per week, for the test262 update PR.

@JLHwung

JLHwung commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Looking at this PR's CI, even without the cache the two jobs completed in about 15 minutes.

Note that the current CI runtime is not the one for uncached job, for example here is the output for the test262 job 1:

# Run 24267 out of 24273 tests.
# Passed 21224 out of 24267 tests.
# Cache: 4945 hits, 1 stale, 14879 misses.

The runtime in this PR still benefit from the cache in the 8-chunk setting. Anyway my previous estimation for half an hour seems too conservative, with two runners the uncached running time might be around 20 minutes.

In practice they will take 15 minutes once per week, for the test262 update PR.

Note that currently the test262 commit PRs does not require bursting the cache. The main will write to the cache automatically for new tests. It is a good point to invalidate some test cache based on git diff changes. I can open a new PR for that purpose.

The cache is keyed by the npm lockfile and the runner source, so any dependabot PR for the test262 runner, or any runner source change will require a cache burst, since we can not statically evaluate the affect from the runner change itself.

Run test262 in 16 chunks to fill the cache from scratch when a test runner
change invalidates it, since this would be slow in the 2 chunks of CI.

Assisted-by: Claude Opus 5.5
This reverts commit ab4c47eb72b7497066bd2293eeb0db7084a3886e.
@JLHwung
JLHwung force-pushed the improve-test262-test-run branch from 28a8ab9 to 548b73f Compare November 4, 2026 15:45
@JLHwung

JLHwung commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

I have reverted and removed the new update-cache-workflow. If there is consensus I will close babel/babel-test262-runner#94.

@babel-bot

Copy link
Copy Markdown
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/63013

@JLHwung JLHwung changed the title ci: run test262 tests in 2 chunks and add update-test262-cache workflow ci: run test262 tests in 2 chunks Nov 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants