Faster Feedback with Parallel Tests

Faster Feedback with Parallel Tests Lisa Crispin December 18, 2019

February 09, 2026 · 5 min read · Testing Guide

Faster Feedback with Parallel Tests

Lisa Crispin
December 18, 2019

In today ’ s continuous world, many teams strive to deploy modest modification to production frequently, often on a daily basis or multiple times per day. To build confidence for continuous delivery or deployment, teams postulate the fast feedback loops possible. They need test results within minutes of each new commit to the source codification repository. Being capable to promptly respond to production issues by getting fixing deployed rapidly is also key. Running automated fixation test suites is an all-important part of that deployment pipeline. The tests postulate to run quickly and dependably.

When to consider running tests in analogue

Breaking up a test suite and running different sections of it concurrently, whether on different machine or virtual machine, is a tried and true practice. It ’ s a good practice in most contexts to hold your end-to-end workflow tests to a minimum. Still, any test running at the UI stage through a browser is going to fulfill more slowly than lower-level tests. Running them in parallel is an obvious way to rush up your CI pipeline.

Today ’ s cloud infrastructure makes it possible to run each exam in its own container. Some test & nbsp; tools, mabl included, proffer this capability, which enable still large numbers of test concurrently. When your feedback arrive as apace as the clip your longest individual tryout occupy to run, your team ’ s deployment pipelines can finish much fast! Teams need this fastness so that they can quickly resolve a production issue by regress or fix a change. & nbsp;

Potential pit

Teams who get running multiple automated tests concurrently often run into trouble, even when running each trial in its own container in the cloud. This can be avoided by having each container also have its own self-contained test surround and trial data. If all the parallel course share one test environment, including the database, tests can create conflicts. For example, if there are two tests that both log in to the application under test with the same account credentials and start making update, those updates can step on each early. Test A may cancel a record that Test B was preparing to update, causing Test B to fail. & nbsp;

Tests can even create standstill conditions, where more than one test tries to update the same records in the database. Here ’ s an example: Test 1 has locked a row in the Employee table to do an update and update the Salary table for the employee as part of the like transaction. Test 2 has several rows engage for update in the Salary table, and also needs to update the same row in the Employee table that is locked by Test 1. Each test will wait for the other to give up the lock, and nothing will happen until the database system detects the deadlock and scrub the transaction being done by one of the tests. & nbsp;

Race weather are also a danger. Let ’ s say you have automate regression tryout around permission levels for individual user, link to security. Test 1 logarithm in as User A, who has update permit, and execute an update. Test 2 change User A ’ s license tier to read-only. If Test 2 runs at the same time as Test 1, Test 1 may end up with unpredictable behavior or an unexpected runtime error.

Race weather can induce cyclical behavior or former unexpected behavior

Preventing the pitfall

Good test design drill avoid contention among multiple concurrent automated tryout. They ’ re useful even if you don ’ t run your tests in analog!

Keep it simple

Keep each case-by-case trial to one open purpose. Don ’ t try to verify multiple scenarios in the same test. Simplifying the tryout makes it easier to hold them from potentially affecting the results of other tests run at the same clip.

For autonomous testing across multiple user personas, check out SUSATest — it explores your app like 10 different real users.

Design independent tests

When possible, it ’ s a full practice for each test to be independent, to set up its own alone test data and province at the start of the test. That extinguish the chance for contestation among multiple tests running at the like time. At the end of the test, whether it runs successfully or not, it should clean up after itself and rejuvenate the scheme to the same state where it started. For example, blue-pencil any test data that it created, undo any updates, leave the campground as clean as when it started. Otherwise, unexpected demeanor could come the next clip the test execute.

Another approach to making sure tests receive the correct data and system province to work with each run is to usecanonical or fixture data.This is a set of datum which is lade into the test environment, so that the same starting values are present each time the tryout suite runs. If any datum is corrupted by an abortive test, it will be render to its normal depart state the next clip the suite kicks off.

Make sure each trial has alone value for variables and data. For example, to test signing up as a new exploiter, generate a random value as piece of the username and email address to prevent duplicate. Any exam that log into the application under tryout should have its own unique exploiter account so that it doesn ’ t interfere with early test that log in and make updates.

“ Stub out ” the part of the coating you aren ’ t testing

If your test or the application they ’ re testing interact with third-party systems or parts of the application they aren ’ t meant to test, study using examination doubles to replace those objective for testing purposes. For representative, have the tests use an in-memory test database instead of a physical database not only helps ensure unique examination information, but also speeds up the tests because I/O is reduced. Mocks can be used to test calls to other parts of the scheme or external applications by verifying the format of the postulation they receive while not do any real actions as a result. & nbsp;

Start small

If you aren ’ t certain whether your be automated tests receive dependencies on each other or on certain trial information, start by running simply a few tests in parallel. After various iterations of successful test runs, you can feel positive to run more tests concurrently. If you do discover problems, you can address them by refactoring each test to make it independent, interrupt it into multiple tests if necessary. You may also need to add to or change your test data so each examination can act with a unique set of tryout value and scheme state. & nbsp;

Modifying tests to run in parallel, and designing new examination with this in judgement, guide to better-designed, more true tests. The practices described hither are important even when tests are run in sequence. Letting the trial ply fast feedback by running them in parallel in the cloud will give your team more self-confidence to deploy modest changes to your production more frequently. & nbsp;

Not sure how to get started?

If this is a new idea for your team, see if you can get assistance from your operations specialists. There are many options for build the infrastructure to be capable to run machine-driven tests in analog in your continuous integrating pipeline. & nbsp;

If the infrastructure is a challenge right now, consider uncommitted tools such as that have the capableness to run machine-controlled tests in parallel as well as in sequence. & nbsp;

 


Resources:

Quality Engineering Resources

Automate This With SUSA

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.

Try SUSA Free

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free