Parallel testing means running several tests at the same time instead of one after another, so the whole suite finishes sooner. For end-to-end tests it's usually the only way to keep a suite fast enough to run on every pull request.
It's also where a lot of flakiness starts. Tests that pass one at a time can fail side by side, and the fix is rarely "add more workers".
Why E2E suites need parallelism
An E2E test opens a browser, loads real pages and waits for real responses. A single test takes seconds to minutes. A suite of a few hundred, run one at a time, takes long enough that nobody waits for it before merging.
On one call we reviewed for this piece, a team running about 600 test cases across several partner instances described full runs taking four to five hours. At that length, the suite runs overnight and finds yesterday's bugs.
Parallelism is the first fix most teams reach for. The other is running fewer tests per change, which we come back to at the end.
The two levels: workers and shards
Workers run tests in parallel on one machine. Each worker is a separate process with its own browser.
Shards split the suite across several machines, and each machine runs its share with its own workers.
You can use both: four CI machines, each with two workers, gives eight tests running at once.
Parallel tests in Playwright
Playwright runs test files in parallel by default, using a number of workers based on your CPU cores. Tests inside one file run in order in the same worker unless you turn on fullyParallel. The details are in the Playwright parallelism docs.
// playwright.config.ts
import { defineConfig } from '@playwright/test';
export default defineConfig({
fullyParallel: true,
workers: process.env.CI ? 2 : undefined,
});
Each test gets a fresh browser context, so cookies and local storage don't leak between tests in the same worker. Server-side state is a different matter, and that's where the trouble starts.
Note what Playwright's own CI guide recommends: setting workers to 1 in CI, to prioritise stability and reproducibility, and using sharding for wider parallelism. The tool's authors are telling you that parallel tests on a shared machine are less stable.
Playwright sharding
Sharding splits the suite across machines with one flag:
npx playwright test --shard=1/4
npx playwright test --shard=2/4
# ...and so on, one per CI job
Each shard produces its own report. Playwright's blob reporter and merge-reports command combine them into one at the end. In GitHub Actions, a matrix of shard indexes gives you one job per shard.
Cypress parallelization
Cypress runs specs one after another on a single machine. To run in parallel across machines, Cypress's parallelization guide requires Cypress Cloud, with each CI machine running:
cypress run --record --key=<record-key> --parallel
Cypress Cloud then hands spec files to machines as they free up, balancing by past run times. The parallelization works well. It also depends on a paid service or a third-party orchestration tool, because the open-source runner doesn't include it. Our Playwright vs Cypress comparison covers the other differences.
Why more workers can mean more failures
On another call, a team running 50 parallel runs against a set of interdependent apps saw failure rates climb, and cutting parallelism brought them back down. Their code hadn't changed. What changed was how many tests hit the same systems at once.
The usual causes:
Shared test data. Two tests edit the same account, project or cart. Run one at a time, they're fine. Run together, one of them sees the other's change. This is the most common cause by far, and test data management for E2E tests covers the fixes.
Order dependency. A test relied on another test running first. Parallel runs and sharding change the order, and the hidden dependency shows up as a random failure.
Login rate limits. Fifty tests logging in within the same second look like an attack to your identity provider. Auth0, Okta, Cognito and most others throttle logins, and the tests fail at step one. Reusing a logged-in session per worker, as Playwright's authentication docs describe, avoids most of this.
Overloaded environments. A small staging database or a single preview container that copes with one browser struggles with twenty. Timeouts follow.
Shared resources outside the app. One test inbox, one SMS number, one payment sandbox account with its own limits.
Machine contention. Too many browsers on one CI runner compete for CPU and memory, and everything slows past its timeouts. That's what Playwright's one-worker CI default guards against.
The research backs this up. In an empirical analysis of flaky tests (FSE 2014), Luo and colleagues found concurrency behind 20% of the flaky tests they studied and test order dependency behind another 12%. Martin Fowler's Eradicating Non-Determinism in Tests makes the same point from the other side: isolated tests are what make parallel runs safe.
How to parallelize E2E tests safely
- Make every test independent. It creates or claims its own data, logs in as its own user, and passes when run alone.
- Run the suite in random order once. Anything that fails is order-dependent. Fix it before adding workers.
- Give each worker its own account, or each test its own, and log in once per worker rather than once per test.
- Size the environment for the load. If staging can handle five concurrent sessions, set five as the limit.
- Scale up gradually. Double the workers, watch the failure rate, and stop when it rises.
- Mark tests that can't run in parallel and run them in a serial group, rather than lowering parallelism for everything.
- Retry with care. A retry that passes hides a race condition. Track tests that pass only on retry and fix them.
The other way to save time: run less per change
Parallelism makes a big suite faster. It doesn't make it smaller, and every extra test adds cost and another chance of a random failure.
For pull requests, the bigger saving is scope. Run the tests that cover what the change touches, against that change's preview environment, and leave the full suite for after merge. Vilhelm von Ehrenheim, our co-founder and Chief AI Officer, frames it as risk: a change to the payment flow deserves more thorough testing than a copy change in the footer, so the testing effort should follow the risk of each change rather than the size of the suite. We make the longer case in why a large regression suite is a liability.
Where QA.tech fits
QA.tech is an AI testing platform, and agent-driven tests are slower per test than a Playwright script on your own runner, so parallelism matters just as much. It also hits the same limits as any other tool: shared accounts collide, and identity providers rate-limit parallel logins. Its docs have a page on auth rate limits for that reason.
What it handles for you is the orchestration. Tests without dependencies run in parallel by default, each in its own isolated browser session, with no fixed cap. You can set a maximum number of concurrent tests per environment, so a small preview gets two at a time while staging gets twenty, and the lowest limit wins. Tests that depend on each other run in sequence automatically. When a run finishes, a review agent reruns suspected flakes, up to twice per test, and reports separately which tests failed, which only passed on retry, and which failed because of setup rather than a bug.
FAQ
What is parallel testing? Parallel testing runs multiple tests at the same time, on several processes or machines, so a test suite finishes faster than it would running tests one after another.
What is the difference between parallel testing and sharding? Parallel testing is the general idea. Sharding is one way to do it: splitting a test suite into parts and running each part on a separate machine. Workers run tests in parallel within one machine.
How do you run Playwright tests in parallel?
Playwright runs test files in parallel by default. Set fullyParallel: true to also run tests within a file in parallel, set the number of workers in the config, and use --shard=x/y to split across machines.
Does Cypress support parallel testing?
Yes, across multiple machines, but Cypress's built-in parallelization requires recording to Cypress Cloud with --record --parallel. Within one machine, Cypress runs specs one after another.
Why do my tests fail when run in parallel but pass alone? Usually because they share data, depend on running in a particular order, or overload a shared resource such as a login service or a small test environment. Make each test independent before adding more workers.
How many parallel workers should I use? As many as your tests and environment can handle without the failure rate rising. Start low, increase gradually, and watch for tests that only fail under load.
