Mutually exclusive tests
-
- UpdatedJan 30, 2025
- 2 minutes to read
- Yokohama
- Automated Test Framework
Prevent conflicting tests from running in parallel by marking them as mutually exclusive. For example, when the system identifies tests that modify the same record, the system makes these tests mutually exclusive. You can also manually mark tests as mutually exclusive.
The system marks tests as mutually exclusive when there is a potential resource conflict.
When the system can't detect resource conflicts automatically, you can create your own mutual
exclusion rules that can prevent conflicting tests from running in parallel. For example, if a
test changes a sys_properties record, the record shows up under Records
Modified of that test. If the validation path of another test depends on the
same sys_properties record without any change, that test fails. This can occur if the previous
test runs at the same time.
You can view mutually exclusive tests on the Mutually Exclusive Tests related list in the test form. This related list shows all tests that don't run in parallel with the current test and the reason. The same test might appear more than once in the list if there are multiple reasons.
Mutually exclusive tests reasons
- Two or more tests modify the same record.
- A test that runs in parallel with itself.
- You can create your own mutual exclusion rules when the system can’t detect resource conflicts automatically.
Mark tests as mutually exclusive
- Mutually Exclusive Tests tab
- Select a test from the Tests list and navigate to to make the selected test mutually exclusive with another test.
- Tests list
- Select one or more tests from the Tests list and choose Add mutually exclusive test from the Action on selected rows context menu. Enter one test in the Add mutually exclusive test dialog box to make the selected tests mutually exclusive with the current test.
- Parallel Test Runs tab
- When two or more tests run in parallel, navigate to Add mutually exclusive
test from the Action on selected rows context menu to mark the selected
tests as mutually exclusive.Note: The Parallel Test Runs tab is visible only if the test runs in parallel with one or more tests.
. Select one or more tests and choose
Related Content
- Reusable tests
Leverage reusable tests to simplify test maintenance and streamline the management of large tests and test suites. Reusable tests reduce redundancy, ensuring consistent and reliable test execution across your system.
- Quick start tests
Copy and customize quick start tests provided by the ServiceNow AI Platform to validate that your instance works after you make any configuration changes. For example, if you apply an upgrade or develop an application.
- Parallel testing
Reduce test design time by running multiple tests and test suites in parallel. Design tests to run in parallel by avoiding resource conflicts and data dependencies.
- Performance profiling
Performance profiling allows you to do performance testing on your instances.