> For the complete documentation index, see [llms.txt](https://docs.redefine.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.redefine.dev/configuration/parallel-test-execution.md).

# Parallel Test Execution

Parallel test execution is a widely adopted strategy designed to speed up the execution of large test suites that otherwise would require considerable time to execute.

When running tests in parallel, organizations will spin up multiple CI machines, distribute the tests across these instances and run the tests using the testing framework of choice.

For example, consider the following code running pytest in parallel on 8 machines in GitHub Actions using the `pytest-split` plugin:

```yaml
name: Redefine

on:
  pull_request:
    branches: [ "main" ]

jobs:
  worker:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        # Running 8 workers
        index: [1,1,1,1,1,1,1,1]
    steps:
      - uses: actions/checkout@v3

      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: 3.11

      - name: Install dependencies
        run: pip install -r requirements.txt

      - name: Run pytest
        run: pytest --splits ${{ strategy.job-total }} --group ${{ strategy.job-index }} -n auto tests/
```

Running tests in parallel means organizations can cut their testing time, but it also means running additional machines which increases the CI costs significantly.

## Redefine

Redefine enhances parallel test execution efficiency, yielding not only time savings for developers but also substantial reductions in CI-related costs. There are multiple supported parallel testing modes:

* [Redefine Parallel](/configuration/parallel-test-execution/redefine-parallel.md) - Optimal test distribution among parallel workers, delivered by Redefine.
* [Remote Workers](/configuration/parallel-test-execution/remote-workers.md) - an Orchestrator + Remote workers architecture, where the Orchestrator runs the prediction first, and the user distributes the tests to the testing machines.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.redefine.dev/configuration/parallel-test-execution.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
