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

# Test Orchestration

The better alternative to Playwright Sharding

Scaling a test suite comes with many challenges. As the test suite grows, CI becomes slower.

Playwright [parallelism](https://playwright.dev/docs/test-parallel) helps reducing the bottleneck, but they aren't as efficient as they could be. Sharding splits test files based on the lexical order of file paths, leading to unbalanced workloads.

Currents Test Orchestrator fixes that by balancing the load using historical execution data, continuously creating the most optimal execution order for test runs, resulting in [up to 40% reduction the CI execution time](https://currents.dev/posts/currents-and-fundguard) with minimal changes to configuration.

<figure><img src="https://3745692499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqmFDEiUa9mr11LUlxDnt%2Fuploads%2FSFVeS0aNygUEgZ9lNRre%2FOrchestration.png?alt=media&amp;token=ecbc5eb7-046c-4f45-85f1-189601ec84a4" alt=""><figcaption></figcaption></figure>

Instead of pre-allocating tests to CI nodes, the orchestrator keeps a live queue of pending tests and dynamically assigns them to machines as they become available. This allows continuous communication and coordination across all nodes, improving overall throughput.

* **Learning from history** - tracks test durations and uses that data to improve distribution in future runs.
* **No renaming hacks** - you don’t need to rename spec files or manually tune splits for better balance.
* **Dynamic test distribution** - tests are split based on real-time machine availability, not pre-assigned upfront.
* **Handles CI quirks** - automatically adapts to runner spin-up delays or unresponsive machines.
* **Scales with your suite** - maintains high throughput as test count, duration, or structure evolves.
* **Your CI, your environment** - the tests are running on your existing environment, the orchestrator client communicates with Currents for task assignments and reporting the results.
* **It's just Playwright** - an orchestrator uses Playwright internally, using the same configuration and interfaces to run the tests.

### Get Started

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td><strong>Technical Deep Dive</strong></td><td><sup>Fully understand how Test Orchestration works and how it compares to native Playwright Sharding.</sup></td><td><a href="/guides/ci-optimization/playwright-parallelization.md">Playwright Parallelization</a></td><td><a href="https://3745692499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqmFDEiUa9mr11LUlxDnt%2Fuploads%2FuUKHS2vjzjRYuhgUWwxC%2Fcurrents-orchestration-queue.png?alt=media&amp;token=bfeaf3f1-397a-4d45-9686-9f9750b07d32">currents-orchestration-queue.png</a></td></tr><tr><td><strong>Setup Orchestration</strong></td><td><sup>Read the guide on how to setup Test Orchestration in your test suite.</sup></td><td><a href="/guides/ci-optimization/playwright-orchestration.md">Orchestration Setup</a></td><td data-object-fit="contain"><a href="https://3745692499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqmFDEiUa9mr11LUlxDnt%2Fuploads%2Fl3AUQ3L6DcZCLneBBH3C%2Fplaywright-logo-neo.png?alt=media&amp;token=a89ab480-a068-4969-91fc-d45ae1dcb8b9">playwright-logo-neo.png</a></td></tr></tbody></table>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.currents.dev/guides/test-orchestration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
