October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk7 min

How to Speed Up Playwright Tests Without Making Them Flaky

A practical guide to speeding up Playwright runs with measured worker tuning, safe parallelism, CI sharding, lean diagnostics, and faster targeted feedback.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The most reliable way to speed up Playwright tests is to find where the run spends time, then increase concurrency only for tests that are genuinely independent. Start by measuring a representative run, tune workers against the actual runner and application capacity, and use sharding if one machine is still the limit. Keep retries and targeted commands in their proper role: they can improve diagnosis or feedback, but they do not make a complete passing suite intrinsically faster.

Find the bottleneck before changing concurrency

Record a baseline on the same kind of CI runner, with the same browser projects, test selection, and reporting settings you normally use. Compare several runs rather than relying on one unusually fast or slow result. The Playwright documentation explains configuration options, but does not establish a universal benchmark or speedup: the result depends on test duration, machine resources, application behavior, and external services.

Look for the constraint that is actually limiting the run:

  • Runner saturation: CPU or memory pressure may mean additional workers will compete rather than finish more work sooner.
  • Application or backend contention: a busy test environment, rate limits, shared accounts, or database locks can make parallel tests slower or flaky.
  • Serial work: files run in parallel by default, but tests within each file run in order unless you opt into test-level parallelism.
  • Setup and diagnostics: browser installation, project selection, and trace collection can add work around the tests themselves.

Make one change at a time and compare like with like. More workers and more shards are options to test, not promises of linear scaling.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Tune workers for the runner you actually have

Playwright Test runs test files in parallel by default. The current configuration reference documents a default worker count of half the logical CPU cores; treat it as a starting point, not an ideal value for every CI machine. You can set the count explicitly in the configuration:

import { defineConfig } from '@playwright/test';

export default defineConfig({
  workers: process.env.CI ? 4 : undefined,
});

Replace 4 with a value you have measured on your CI runner. If the local configuration already supplies a suitable default, avoid hard-coding a count just for the sake of it. Increase gradually while tracking elapsed time, CPU and memory pressure, backend load, and flaky failures. If elapsed time stops improving or reliability worsens, reduce the count or address the contention first.

Worker processes can run independently, but they still share the capacity of the host and may send simultaneous traffic to the same application. The right count is therefore constrained by both the runner and the system under test.

Enable test-level parallelism only after isolating state

By default, Playwright runs test files in parallel and tests in each file in order. Independent tests can be spread across workers within a file with fullyParallel: true, or within a selected suite with test.describe.configure({ mode: 'parallel' }). See the Playwright parallelism guide for the current behavior and configuration details.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
import { defineConfig } from '@playwright/test';

export default defineConfig({
  fullyParallel: true,
});

Before enabling it, check what each test reads and changes. Playwright creates an isolated BrowserContext per test, separating browser cookies and storage, but that does not isolate a shared database, account, file, or application-wide setting. Tests that rely on an order or mutate the same backend record can fail once they overlap.

Make test data and artifacts unique

  • Give each test its own backend record or identifier, using testInfo.testId as one source of uniqueness.
  • Write per-test files under testInfo.outputPath() rather than a shared hard-coded path.
  • Use worker-scoped fixtures or data only when sharing within a worker is intentional and safe.
  • Remove module-level mutable state and side effects that assume a single test is running.

If tests are inherently dependent, keep the necessary ordering explicit instead of making them parallel simply to reduce the clock time. The parallelism documentation recommends independence so tests can run and be retried separately.

Shard a suite across CI machines when one runner is not enough

Sharding splits a test run among separate CI jobs. For example, a three-job matrix can run:

npx playwright test --shard=1/3
npx playwright test --shard=2/3
npx playwright test --shard=3/3

Configure each command as a separate job on its own runner, and collect or merge the resulting reports as appropriate for your CI setup. Shards only help if the jobs run concurrently and the suite is safe to distribute. They also add runner startup and orchestration overhead, so compare total completion time and infrastructure cost with a single-runner baseline.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Distribution can be uneven. Without fully parallel execution, files are the assignment unit, so a few long files may leave some shards idle while another finishes. The Playwright next-version sharding guide describes test-level balancing with fully parallel execution. Because this detail is documented on the next-version page, check it against the Playwright version installed in your project before depending on it.

Choose workers or shards based on the constraint

  • More workers on one runner avoids coordinating additional jobs, but is limited by that runner’s CPU and memory and may intensify backend load.
  • More shards on separate runners can use additional machine capacity, but bring startup cost, shard-balance concerns, and more simultaneous traffic to the application.

Neither approach has a documented universal speedup. Measure the result with your suite, runner type, and test environment.

Reduce setup and routine diagnostic overhead

Install only the browsers a job needs

In CI, install only the browser engines required by that job rather than downloading every browser unnecessarily. When a job is intended to cover just one configured browser project, select that project explicitly, for example with --project=chromium. Make this match your browser-coverage policy; narrowing a job must not silently remove required coverage. Playwright’s best-practices guide covers installing browsers for CI.

Collect traces when they are useful

A trace can help explain a failure through action timings, DOM snapshots, and network requests in the Trace Viewer. For routine CI runs, Playwright recommends collecting a trace on the first retry:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
import { defineConfig } from '@playwright/test';

export default defineConfig({
  use: {
    trace: 'on-first-retry',
  },
});

Tracing every test adds overhead; use it when its additional visibility is worth that cost. The Trace Viewer documentation explains how to inspect a recorded trace.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Get faster feedback without confusing it with a faster full run

During development, run the relevant test or browser project instead of the entire matrix. For example, use npx playwright test tests/login.spec.ts --project=chromium to focus on a file and project. After a run, npx playwright test --last-failed targets tests that failed previously. These commands shorten a feedback loop; they are not optimizations for the runtime of a full successful suite.

In CI, --max-failures can stop a run after a chosen number of failures:

npx playwright test --max-failures=5

Use a limit that fits your team’s failure policy. It avoids spending resources on a run that is already clearly broken, but does not make a complete passing run faster. The CLI reference documents these options.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Retries reveal instability; they are not a speed optimization

Playwright retries failing tests and classifies outcomes as passed, flaky, or failed. A test that passes only after a retry still signals instability; retries do not make the underlying test faster. Serial groups are retried together, another reason to keep tests isolated when possible. Use retry results to investigate nondeterminism rather than treating eventual success as evidence that a parallelism change is safe. See the retry documentation.

Troubleshoot slow or newly flaky runs

  • More workers did not shorten the run: compare CPU and memory pressure and inspect application or backend contention. Try a lower count; worker count is not a linear speed control.
  • Failures appeared after enabling parallel mode: look for shared accounts, backend records, files, module state, or order assumptions. Make those resources independent or retain the required ordering.
  • One shard takes much longer than the others: check whether long test files are concentrated in a shard. Confirm the installed version’s supported distribution behavior and whether fully parallel execution is appropriate.
  • CI setup remains slow: verify that the job installs only the browser engines it needs and selects only intended projects, without dropping required coverage.
  • Trace-heavy runs are slower: reserve routine traces for the first retry unless continuous trace collection is worth the overhead for your debugging needs.
  • The run passes after retries but remains unreliable: examine the flaky tests and their shared state rather than increasing retries as a substitute for isolation.

Or skip the browser setup

If your task is to capture a website rather than run an interactive browser test suite, ScreenshotNeo offers a one-request screenshot API and MCP server. A screenshot call looks like this:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo documentation for parameters and response details. Before capture it can accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, with response headers indicating the page verdict and billing status. Its MCP server exposes screenshot and PDF capture tools to AI agents. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for 1,000 free screenshots a month, with no card required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Does enabling `fullyParallel` guarantee a faster Playwright run?

No. It makes independent tests eligible for more concurrency, but available runner capacity, test isolation, and application load determine whether the run gets faster.

Do Playwright retries reduce test runtime?

No. Retries can help diagnose intermittent failures, but they may add work and do not speed up the underlying test.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.