Skip to main content
All CollectionsTroubleshootingComparisons
Running tests synchronously in a test monitor
Running tests synchronously in a test monitor

How to change the behavior of your Salesforce org such that test monitor runs will run the tests sequentially instead of in parallel

Valerio Chang avatar
Written by Valerio Chang
Updated over a year ago

When doing a deployment to a Salesforce org via the Metadata API, Salesforce runs all the tests in your org sequentially (synchronously). This is different to the default behavior you'll see if you run your tests manually through the Salesforce UI or via the Tooling API, where the tests are run in parallel. Because Gearset test monitors use the Tooling API, this means your test monitors will run all of your tests in parallel (asynchronously).

Sometimes you might not want your tests to run asynchronously, as the tests could share state and thus tread on each other's toes, resulting in unexpected test failures.

If you're hitting these issues, and are unable to fix your tests at the moment, then you can change the default behavior by heading over to the Salesforce UI and clicking Disable Parallel Apex Testing for Apex test execution. Once you've done this, any test monitor jobs set up to run on that org will now run your tests one at a time.

Did this answer your question?