CTest parallel run by default
CMake environment variable CTEST_PARALLEL_LEVEL can be manually set to control default test parallel runs. It’s often desired to run tests in parallel to save time, and help ensure there aren’t hidden dependencies between tests. That is because CTest when run in parallel will effectively randomize the order of the tests, while maintaining dependencies setup by CTest fixtures and resource locks. We usually set CTEST_PARALLEL_LEVEL environment variable to be equal to the number of physical CPU cores as a starting point.
If the computer runs out of RAM or has conflicts with parallel tests, then use Resource Locks and/or Fixtures to control the parallelism on a per-test basis.