I am trying to run a test that verifies the functionality of some system global state variables. For example: "enable feature A, test that feature A works, disable feature A, test that feature A no longer works". I cannot create a separate system for each test, so the state will be shared between tests.
The bulk of my tests do not touch this global state or depend on it and I want to parallelize as much as possible, is there a way (such as a mutex) to run most of the tests in parallel but a single test (or group of tests) as mutually exclusive with other tests related to the state?