Skip to content

Run tests across several processes on CI - #4000

Open
gunndabad wants to merge 3 commits into
mainfrom
claude/ci-test-lanes
Open

gunndabad wants to merge 3 commits into
mainfrom
claude/ci-test-lanes

Conversation

@gunndabad

Copy link
Copy Markdown
Member

Tests in DisableParallelization collections run one at a time and make up most of CI's test time: 150s of the 156s Core.Tests takes. Each process now has its own database (#3999), so they can run side by side in separate processes.

  • Add scripts/RunTests.cs, which splits a job's classes across up to 4 processes; this replaces the shard logic in pr.yml and the test composite action
  • Add tests/test-timings.json to balance classes and set shard counts, refreshed with just update-test-timings <run ID>; it's committed because tests don't run on main, and a class with no timing is estimated from its test count
  • Keep EndToEndTests at one process per job since its hosts use fixed ports; timings give it 5 shards rather than 3
  • Pull the Postgres image during the build and turn off Ryuk on CI
  • Add just test-project Core.Tests for the same split locally
  • Run every test project when pr.yml or RunTests.cs changes; without this, this PR wouldn't have run any tests

Locally, 4 processes took Core.Tests from about 69s to 28–36s, Api.IntegrationTests from 42s to 18–22s and SupportUi.Tests from 69s to 35–42s. CI's gain will be smaller, since setup and build take 100–150s per job. The last comparable run took 317s in total.

🤖 Generated with Claude Code

gunndabad and others added 2 commits November 6, 2026 12:40
Split each job's classes across processes, each with its own database,
so tests that must run serially within a process run side by side.
Balance shards and processes using committed timings, give EndToEndTests
more shards as its hosts need fixed ports, and pull the Postgres image
during the build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Changes to pr.yml or RunTests.cs don't touch any project, so they would
otherwise skip all tests while changing how every test runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
At 45 seconds Api.IntegrationTests fell just inside a single shard and
became the longest job, limited by CPU rather than serial tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant