---
title: Test Parallelization
description: >-
  Reduce CI testing time by distributing test files across CI nodes or workers
  with Test Optimization data.
breadcrumbs: Docs > Test Optimization in Datadog > Test Parallelization
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Test Parallelization

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

## Overview{% #overview %}

Test Parallelization helps you shorten test runs and use CI resources more efficiently by balancing test files across CI nodes or local workers. It uses test duration data from Test Optimization to balance the workload so CI nodes finish at roughly the same time.

Pair Test Parallelization with [Test Impact Analysis](https://docs.datadoghq.com/tests/test_impact_analysis.md) to reduce CI costs further. Test Impact Analysis skips tests unaffected by your code change. Test Parallelization automatically scales down the CI node count to match the remaining workload. This saves the cost and time of provisioning and setting up unnecessary runners.

## Setup{% #setup %}

Before setting up Test Parallelization, set up [Test Optimization](https://docs.datadoghq.com/tests/setup.md). Optionally, also set up [Test Impact Analysis](https://docs.datadoghq.com/tests/test_impact_analysis.md) if you plan to use it with Test Parallelization. Then [choose your CI provider, language, and framework](https://docs.datadoghq.com/tests/test_parallelization/setup.md) and follow the instructions.

## Compatibility{% #compatibility %}

Test Parallelization is supported for the following languages and frameworks:

| Language   | Frameworks                                                         | Minimum library version              |
| ---------- | ------------------------------------------------------------------ | ------------------------------------ |
| Ruby       | RSpec, Minitest                                                    | `datadog-ci` gem `1.42.0` or later   |
| Python     | pytest                                                             | `ddtrace` package `4.11.0` or later  |
| JavaScript | Cucumber.js, Cypress, Jest, Mocha, Playwright, Vitest, WebdriverIO | `dd-trace` package `6.14.0` or later |

[WebdriverIO](https://docs.datadoghq.com/tests/test_parallelization/setup.md?prog_lang=javascript&platform=webdriverio#webdriverio) requires the local runner with Mocha or Jasmine.

## How it works{% #how-it-works %}

Test Parallelization uses the `ddtest` CLI to plan and run tests:

1. Run `ddtest plan` once to create a fresh `.testoptimization/` plan for that workflow, suite, and execution environment.
1. Share the `.testoptimization/` directory with each CI job that runs tests.
1. Run `ddtest run --ci-node <CI_NODE_INDEX>` in each CI job to execute only the files assigned to that CI node.

For single-node and multi-node examples, see [Set Up Test Parallelization](https://docs.datadoghq.com/tests/test_parallelization/setup.md).

## Next steps{% #next-steps %}

Install ddtest, configure your CI provider, and customize how Test Parallelization splits test files.

- [Set up Test Parallelization](https://docs.datadoghq.com/tests/test_parallelization/setup.md)
- [Configure Test Parallelization](https://docs.datadoghq.com/tests/test_parallelization/configuration.md)
- [Best Practices for Test Parallelization](https://docs.datadoghq.com/tests/test_parallelization/best_practices.md)
- [Troubleshooting Test Parallelization](https://docs.datadoghq.com/tests/test_parallelization/troubleshooting.md)
 
## Further reading{% #further-reading %}

Additional helpful documentation, links, and articles:

- [Ship faster, improve reliability, and control CI costs with Datadog CI/CD Optimization](https://www.datadoghq.com/blog/ci-cd-optimization/)
