Skip to content

Serialize only the log-capture tests, not the whole suite#823

Merged
ptr727 merged 1 commit into
developfrom
fix/selective-test-parallelization
Jul 11, 2026
Merged

Serialize only the log-capture tests, not the whole suite#823
ptr727 merged 1 commit into
developfrom
fix/selective-test-parallelization

Conversation

@ptr727

@ptr727 ptr727 commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Problem

#821 added xunit.runner.json with parallelizeTestCollections: false to fix a race in the tests that swap the global Serilog Log.Logger. That disabled parallelization for the entire suite, slowing every test.

Fix

Follow the ptr727/LanguageTags pattern (LanguageTagsTests/Fixture.cs): a dedicated collection with DisableParallelization, applied only to the classes that need it.

  • Removed the assembly-wide xunit.runner.json.
  • Added [CollectionDefinition("Sequential", DisableParallelization = true)].
  • Marked only ToolFailureLogFormatTests and FfProbeLogTests (the ones that swap Log.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.

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.
Copilot AI review requested due to automatic review settings July 11, 2026 00:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json that disabled parallel test collections for the entire suite.
  • Introduced a dedicated xUnit collection ("Sequential") with DisableParallelization = true for tests that mutate global static state.
  • Applied [Collection("Sequential")] only to ToolFailureLogFormatTests and FfProbeLogTests.

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.

@ptr727
ptr727 merged commit ee7a5ca into develop Jul 11, 2026
15 checks passed
@ptr727
ptr727 deleted the fix/selective-test-parallelization branch July 11, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants