> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qa.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Parallel Test Execution and Concurrency Limits

> Control how many QA.tech test cases run in parallel. Set per-environment concurrency limits to protect staging servers or maximize throughput on production.

QA.tech runs independent test cases in parallel so test plans finish faster than running tests one at a time. By default, there is no cap on how many tests can run at once. You can set a **Maximum Concurrent Tests** limit on each environment when you need to protect shared infrastructure or control load on a target URL.

## How Parallel Execution Works

When you trigger a test plan or multi-test run, QA.tech schedules tests based on your [dependency graph](/core-concepts/dependencies):

| Test relationship                   | Execution behavior                                                     |
| ----------------------------------- | ---------------------------------------------------------------------- |
| Independent tests (no dependencies) | Run in parallel, each in its own isolated browser session              |
| Tests in the same dependency chain  | Run sequentially within the chain                                      |
| Tests linked by Wait For            | Dependent test waits for output data; chains can still run in parallel |

With no concurrency limit configured, QA.tech auto-scales to run many tests at the same time. A test plan with 20 independent three-minute tests can finish in roughly three minutes instead of an hour.

<Note>
  Parallel execution respects [test dependencies](/core-concepts/dependencies).
  Limits control how many tests run at the same time within a single run; they
  do not change dependency order.
</Note>

## Configure in the Dashboard

Concurrency limits are configured **per environment**, not per organization or project. Leave **Maximum Concurrent Tests** empty for unlimited parallel runs, or enter a positive number to cap concurrency for that environment.

<Steps>
  <Step title="Open Applications & Envs">
    Go to [**Settings → Applications &
    Envs**](https://app.qa.tech/current-project/settings/applications) and
    select the application.
  </Step>

  <Step title="Edit an environment">
    Scroll to **Environments**, open the hamburger menu on the environment you
    want to change, and click **Edit**.
  </Step>

  <Step title="Set Maximum Concurrent Tests">
    Leave the field empty for unlimited parallel runs, or enter a positive
    number to limit concurrency.
  </Step>

  <Step title="Save">
    Click **Save** to apply the limit to future runs that use that environment.
  </Step>
</Steps>

## How Limits Apply During a Run

When a run starts, QA.tech reads the limit from each environment used by tests in that run and applies the **most restrictive** value:

```
Run uses Environment A (limit: 10) and Environment B (limit: 5)
→ Effective limit for the run: 5
```

| Scenario                                     | Effective limit           |
| -------------------------------------------- | ------------------------- |
| All environments unlimited                   | No cap; full auto-scaling |
| One environment set to `5`, others unlimited | `5`                       |
| Environment A: `10`, Environment B: `3`      | `3` (minimum wins)        |

Tests that exceed the limit are **queued**, not skipped. QA.tech delays extra tests and starts them as slots open, so the full test plan still completes.

## When to Set a Limit

Use **Maximum Concurrent Tests** when parallel runs could overwhelm the environment you are testing:

| Situation                                   | Suggested approach                                                      |
| ------------------------------------------- | ----------------------------------------------------------------------- |
| Shared staging server with limited capacity | Set a low limit (for example `3` to `5`) on the staging environment     |
| Production smoke tests on a live site       | Use a conservative limit to avoid traffic spikes                        |
| Dedicated preview or load-test environment  | Leave unlimited or set a high limit                                     |
| CI runs against ephemeral preview URLs      | Often unlimited; set a limit if your preview host throttles connections |

Leave the field **empty** when you want the fastest possible test plan execution and your infrastructure can handle concurrent load.

## Maximize Parallelism Without Overloading

Parallel execution speed depends on how tests are structured:

1. **Reduce unnecessary dependencies** - Independent tests run at the same time; long dependency chains run one after another. See [Test Dependencies](/core-concepts/dependencies).
2. **Set limits per environment** - Use a lower limit on staging and a higher or unlimited limit on dedicated test environments.
3. **Use Resume From for shared login** - Reuse browser state within a chain instead of creating many parallel login tests against the same auth endpoint.

For test plan execution patterns and scheduling, see [Test Plans](/core-concepts/test-plans) and [Running Tests](/best-practices/running-tests).

## Frequently Asked Questions

<Accordion title="Can I set a concurrency limit for my whole organization or project?">
  No. Limits are configured per **environment** under **Settings → Applications
  & Envs**. If you need the same cap everywhere, set it on each environment
  (staging, production, and so on).
</Accordion>

<Accordion title="Does a limit of 5 mean only five tests ever run?">
  No. Up to five tests run **at the same time** for that run. When one finishes,
  the next queued test starts. The full plan still runs to completion.
</Accordion>

<Accordion title="Do dependency chains count as one parallel slot?">
  Each **active test** uses a slot. Tests in the same chain run one after
  another, so they typically use one slot at a time for that chain. Independent
  chains each use their own slots up to your limit.
</Accordion>

<Accordion title="Can I set the limit via API?">
  Not today. **Maximum Concurrent Tests** is configured in the dashboard on each
  environment. Per-run API overrides support environment URLs and device
  presets; see [Start Run API](/api-reference/runs/start-test-run).
</Accordion>

<Accordion title="What happens if I leave Maximum Concurrent Tests empty?">
  The environment has no concurrency cap. QA.tech parallelizes independent tests
  and scales concurrent agents based on demand.
</Accordion>

## Related Documentation

* [Projects, Applications, Environments](/core-concepts/applications-and-environments) - Where environments and URLs are defined
* [Test Plans](/core-concepts/test-plans) - Group tests and trigger parallel runs
* [Test Dependencies](/core-concepts/dependencies) - Control order and browser isolation
* [Running Tests](/best-practices/running-tests) - Trigger runs from the UI, CI/CD, or schedules
