[WIP] Add an experimental .serialized(.globally)
trait.
#913
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a variant of the
.serialized
that causes annotated tests and suites to run in serial after all other test content has run, in effect allowing them to opt out of parallelization entirely.This PR introduces a new concept to a runner plan, "stages." The names of stages are arbitrary, but the point is that they run in a fixed order and different work is performed in each stage. Test functions always run in a single stage, while test suites may get smeared across multiple stages. Normal test work is performed in the first stage, with a second stage that runs everything in it serially. Hence, any test that gets put in that second stage runs in a globally serialized order.
"Globally" here does not refer to multi-process parallelization, which is a whole 'nother animal. If we ever add support for that, we'll presumably want tests in this stage to be serialized even between processes.
Stages aren't API or SPI, although we could potentially promote it to either in the future.
Resolves rdar://135288463.
Checklist: