Thanks. We use feature flags across our codebase. These are accessed from a static class & each flag is an interface. When the app starts, it loads config in & creates an instance for each flag, which as the code runs it can then see if the flag is enabled.
When we write a test, we mock the state of any affected flags. We write a test where the flag is on & another test when the flag is off. So you end up with a number of tests where a flag is on & some where the flag is off. All the tests where the flag is in a given state can be run at the same time, but should not be run where the flag is in the other state.
test 1 - no flags
test 2 - flag A on
test 3 - flag A on
test 4 - flag A off
test 1 can be run concurrently with any other test
test 2 & 3 can be run together but should not run when test 4 is run
test 4 should not run when test 2 & 3 are running
What we do right now is mark every test with the exclusively uses flag based on the flag name, so for above tests 2,3, &4 would be marked exclusivelyuses("flag a"). The problem with this is test 1,2, & 3 get run on after another, so it obliterates must of the concurrency we would otherwise benefit from.
This assumes a static set by 1 test in a runner would affect a test running in another runner... I'm now wondering if my assumption is correct, based on what it says here:
https://www.ncrunch.net/...cepts_parallel-execution