Serialize only the log-capture tests, not the whole suite#823
Merged
Conversation
Replace the assembly-wide xunit.runner.json parallelizeTestCollections:false (which slowed every test) with a "Sequential" collection that has DisableParallelization. Only the tests that swap the global Serilog Log.Logger (ToolFailureLogFormatTests, FfProbeLogTests) join it; the rest of the suite runs in parallel again.
There was a problem hiding this comment.
Pull request overview
This PR restores xUnit parallel execution for the test suite while keeping only the Serilog Log.Logger-swapping tests isolated and sequential, addressing the suite-wide slowdown introduced in #821.
Changes:
- Removed the assembly-wide
xunit.runner.jsonthat disabled parallel test collections for the entire suite. - Introduced a dedicated xUnit collection (
"Sequential") withDisableParallelization = truefor tests that mutate global static state. - Applied
[Collection("Sequential")]only toToolFailureLogFormatTestsandFfProbeLogTests.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| PlexCleanerTests/xunit.runner.json | Removed suite-wide parallelization disablement. |
| PlexCleanerTests/PlexCleanerTests.csproj | Dropped copying xunit.runner.json into test output. |
| PlexCleanerTests/PlexCleanerFixture.cs | Added "Sequential" collection definition with DisableParallelization = true. |
| PlexCleanerTests/ToolFailureLogFormatTests.cs | Marked test class as part of "Sequential" collection. |
| PlexCleanerTests/FfProbeLogTests.cs | Marked test class as part of "Sequential" collection. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
#821 added
xunit.runner.jsonwithparallelizeTestCollections: falseto fix a race in the tests that swap the global SerilogLog.Logger. That disabled parallelization for the entire suite, slowing every test.Fix
Follow the ptr727/LanguageTags pattern (
LanguageTagsTests/Fixture.cs): a dedicated collection withDisableParallelization, applied only to the classes that need it.xunit.runner.json.[CollectionDefinition("Sequential", DisableParallelization = true)].ToolFailureLogFormatTestsandFfProbeLogTests(the ones that swapLog.Logger) with[Collection("Sequential")].The rest of the suite parallelizes again; the two log-capture classes run sequentially and isolated. 196 tests pass; local wall-clock is back down (~3s vs ~4s serial). Formatters/linters clean.