Tech, ExplainedCloud platforms and developer tools
Part

Test orchestration

Which tests run, where, and in what order.

INSIDE: CROSS-BROWSER AND REAL DEVICE TESTINGHOW IT WORKS · 6,000 TESTS FOR A FURNITURE SHOP'S WEBSITE IN JAIPURA pull requestchanges thedelivery-datecalculationThe orchestratorpicks the 420tests thatcover thechanged filesThey run on200 browsersat once: allpass in abouttwo minutesThe other5,580 tests arespread: about14 minutesper browserTwo failurespass on a secondrun and aremarked flakyThe fullresult arrivesin about 16minutes, insteadof 50 hoursALSO TALKS TOCode repository↗ DEVOPSINSIDE: CROSS-BROWSER AND REAL DEVICE TESTINGHOW IT WORKS · 6,000 TESTS FOR A FURNITURE SHOP'SWEBSITE IN JAIPURA pull requestchanges thedelivery-date calculationThe orchestrator picksthe 420 tests that coverthe changed filesThey run on 200 browsersat once: all pass inabout two minutesThe other 5,580 tests arespread: about 14 minutesper browserTwo failures passon a second run andare marked flakyThe full result arrivesin about 16 minutes,instead of 50 hoursALSO TALKS TOCode repository↗ DEVOPSINSIDE: CROSS-BROWSER AND REALDEVICE TESTING · 6,000 TESTS FOR AFURNITURE SHOP'S WEBSITE IN JAIPURA pull request changes thedelivery-date calculation↓The orchestrator picks the 420 tests thatcover the changed files↓They run on 200 browsers at once: allpass in about two minutes↓The other 5,580 tests are spread: about14 minutes per browser↓Two failures pass on a second run and aremarked flaky↓The full result arrives in about 16minutes, instead of 50 hoursALSO TALKS TOCode repository↗ DEVOPS
The orchestrator runs the 420 tests that cover the changed files first, then spreads the other 5,580 across 200 browsers, and retries two flaky failures.
opens a page inside this one a page in the same scene a page in another scene a concept page a label only, with no page

Test orchestration is the part of a test grid that decides which tests run, on which devices and in what order, so that a large set of tests finishes as fast as possible. It is also called test scheduling or test splitting. Without it, tests run one after another, and a large set can take hours or days.

Here is the problem. A mature app may have 6,000 automated tests. If each takes about 30 seconds, running them one by one takes 50 hours. Teams want the answer for each change in minutes, ideally before the change is merged. Running tests that early, on every change, is part of shift left testing.

Orchestration uses four methods. First, parallel runs: it splits the tests across many machines or devices at once. Second, balancing: it knows from earlier runs how long each test takes. So it gives each machine an equal amount of work, and no machine finishes long after the others. Third, test selection: it reads which files a change touched, and first runs the tests that cover those files. Fourth, failure handling: it runs early the tests that failed recently. And when a test fails, it can run it once more. This separates a real failure from a flaky test, a test that sometimes fails for reasons that have nothing to do with the code, such as a slow network.

Imagine an online furniture shop in Jaipur with 6,000 tests for its website. A developer opens a pull request that changes how the delivery date is calculated. The code repository sends the change to the grid. The orchestrator finds 420 tests that cover the changed files. It runs those first, on 200 browsers in parallel, and has an answer in about two minutes: all pass. The developer can carry on working. The orchestrator then spreads the other 5,580 tests, so that each of the 200 browsers has about 14 minutes of work. Two tests fail, then pass when they run again. The orchestrator marks them as flaky and reports them separately, so that someone repairs them later. The full result arrives in about 16 minutes, instead of 50 hours.

Orchestration is a part of the cloud test grid, which provides the devices and browsers. The tests themselves are written separately, in test automation tools. Orchestration does not change what a test checks. It only changes when and where each test runs.

Tech, Explained is a part of ingrid.fyi. Every page explains one piece of technology in plain words.