---
schema_version: "1"
id: 178d32c02a440150b14b375ae174c008e3fefc3e52fd7c6290ddeae175d7f188
title: Disable Parallel Test Execution
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/code_test_execution_disable_parallel.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.code_test_execution_disable_parallel.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 458148a3ccf38968858e9b57f3d870ada4176866b59ee1fa2d65a341c9edca75
description: Tests that are started from the Salesforce user interface (including the Developer Console) run in parallel. Parallel test execution can speed up test run time. Sometimes, parallel test execution results in data contention issues, and you can turn off parallel execution in those cases.
products:
  - Salesforce Platform
release: "264"
---
# Disable Parallel Test Execution

Tests that are started from the Salesforce user interface (including the Developer Console) run in parallel. Parallel test execution can speed up test run time. Sometimes, parallel test execution results in data contention issues, and you can turn off parallel execution in those cases.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition">
        <colgroup>
          <col>
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>Available in: <span id="code_test_execution_disable_parallel__Apex_Code_editions_text"><a name="code_test_execution_disable_parallel__Apex_Code_editions_text"><!-- --></a><strong>Enterprise</strong>, <strong>Performance</strong>,
                  <strong>Unlimited</strong>, <strong>Developer</strong>, and <strong>Database.com</strong> Editions</span></p>
              <p style="margin-bottom:0;">See <a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_supported_editions.htm&amp;type=5&amp;language=en_US" target="_blank">Supported Editions for Flow Builder and Licenses for
                  Integrated Features</a></p>
            </td>

          </tr>
        </tbody>
      </table> <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:74%">
          <col style="width:26%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d30933e83">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d30933e83 ">
              <span id="code_test_execution_disable_parallel__class_perm_text"><a name="code_test_execution_disable_parallel__class_perm_text"><!-- --></a>To define, edit, delete, set security, and set version settings for
                Apex classes:</span>
            </td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d30933e83 ">
              <span id="code_test_execution_disable_parallel__apex_perm_value"><a name="code_test_execution_disable_parallel__apex_perm_value"><!-- --></a>Author Apex</span>
            </td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d30933e83 ">
              <span id="code_test_execution_disable_parallel__class__runtest_perm_text"><a name="code_test_execution_disable_parallel__class__runtest_perm_text"><!-- --></a>To run Apex tests:</span>
            </td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d30933e83 ">
              <span id="code_test_execution_disable_parallel__apex_runtest_perm_value"><a name="code_test_execution_disable_parallel__apex_runtest_perm_value"><!-- --></a>View Setup and Configuration</span>
            </td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d30933e83 ">To open, edit, or create a flow test in Flow Builder:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d30933e83 ">Manage Flow</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d30933e83 ">To view test run details in Flow Builder:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d30933e83 ">View All Data</td>

          </tr>
        </tbody>
      </table>

In particular, data contention issues and `UNABLE_TO_LOCK_ROW` errors can occur in these cases.

- When tests update the same records at the same time—Updating the same records typically occurs when tests don’t create their own data and turn off data isolation to access the org’s data.
- When a deadlock occurs in tests that are running in parallel and that try to create records with duplicate index field values—Test data is rolled back when a test method finishes execution. A deadlock occurs when two running tests are waiting for each other to roll back data, which happens if two tests insert records with the same unique index field values in different orders.

You can prevent receiving those errors by turning off parallel test execution in the Salesforce user interface.

1. From Setup, enter Application in the Quick Find box, select **Application Test Execution**, then click **Options...**.
2. In the Application Test Execution Options dialog, select **Disable Parallel Apex Testing** and then click **OK**.

For more information about test data, see Isolation of Test Data from Organization Data in Unit Tests in the [Apex Code Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/). This option doesn’t affect the execution order of tests, which continue to run asynchronously from the Application Test Execution page.