Making a test suite fast: selection, sharding and parallel runs
Get answers sooner by running fewer checks, running them side by side and splitting them across machines, without breaking trust.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: checkout tills. A shop has one till and a long queue. The shop opens four tills, and the queue moves faster. It also opens a fast till for people with a few items. But if two tills share one cash drawer, the sums go wrong. So tills need to be kept apart.
Daily List is a to-do list app. Its automated checks now take most of an afternoon. Leo changes one in the morning and gets his answer after he has gone home. A slow answer is a late answer.
Mei says: three ideas can help. Run fewer checks. Run some at the same time. Split them over several machines. All three need care, and the care is about keeping checks apart.
The picture has limits. Shoppers do not depend on each other. Checks sometimes do, and that is where it goes wrong.
(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Getting a faster answer from a large suite by running fewer checks, running some side by side and splitting the rest across machines.
- Measure the slow checks
- Run fewer
- Run some together
- Keep each check apart
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| One long queue | A slow suite |
| A fast till for few items | A quick set for each change |
| More tills | More workers or machines |
| A shared cash drawer | Shared data that breaks checks |
WHERE THIS PICTURE STOPS
- Shoppers do not depend on each other. Checks sometimes do.
- Opening a till is easy. Making checks independent takes work.
- A queue is fair to everyone. A split by time is not fair, but it is faster.
HOOK
Fewer, together, apart.
REMEMBER IT THIS WAY
A rule of thumb: if you see this, think that.
If checks will run side by side, usually give each its own data first so they stay apart.
| In the trick | What it stands for |
|---|---|
| Side by side | run some at the same time |
| Own data | shared data that breaks checks, tills share one cash drawer |
Checks that only read data nobody changes can often share it safely.
TELL A FRIEND
A busy shop opens more tills and a fast till, but never shares a cash drawer.
OFTEN MIXED UP WITH Flaky tests. The flaky-tests lesson finds checks that give mixed results. This lesson uses isolation so that running at the same time does not create them.
PRACTISE AND KEEP
Sources for this topic — 8 sources
- Market practice
Sharding (Playwright documentation) ↗ — Microsoft (Playwright) · A suite can be split into shards that run on separate machines, while workers are processes on one machine (search excerpt, page not opened)
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
- Market practice
Running tests across multiple CPUs (pytest-xdist documentation) ↗ — pytest-xdist · A plugin spreads tests across worker processes, and modes keep tests of one file or scope together on the same worker (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Grid architecture (Selenium documentation) ↗ — Selenium · A grid is built from parts such as a router, a distributor, nodes and a session map (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Test Impact Analysis (Datadog documentation) ↗ — Datadog · Test impact analysis runs the tests that cover changed code and cannot detect changes to dependencies, external services or data files (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Test Sizes (Google Testing Blog, December 2010) ↗ — Google · Tests are sorted by size, small, medium and large, by what they need to run (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
How we sharded our test suite for 10x faster runs on GitHub Actions (Gel blog) ↗ — Gel (formerly EdgeDB) · Splitting a suite by past test durations so shards finish together; a bug in the splitting step could leave some tests unrun (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Continuous Integration (Martin Fowler) ↗ — Martin Fowler · No figure stated on purpose: a MoT thread on how long a CI suite should take shows no consensus; Fowler's CI article is cited for fast feedback only (search excerpt via secondary sources; the ten-minute wording was NOT confirmed first-hand). Stage targets are a team choice, taught as such.
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
How long on average should test automation take to execute all checks in a CI/CD pipeline? ↗ — Ministry of Testing Club · No figure stated on purpose: a MoT thread on how long a CI suite should take shows no consensus; Fowler's CI article is cited for fast feedback only (search excerpt via secondary sources; the ten-minute wording was NOT confirmed first-hand). Stage targets are a team choice, taught as such.
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.