# 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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
