Skip to content

Change integration test parallelization from ClassLevel to MethodLevel#15526

Merged
nohwnd merged 2 commits intomicrosoft:mainfrom
nohwnd:fix/15488-method-level-parallel
Mar 20, 2026
Merged

Change integration test parallelization from ClassLevel to MethodLevel#15526
nohwnd merged 2 commits intomicrosoft:mainfrom
nohwnd:fix/15488-method-level-parallel

Conversation

@nohwnd
Copy link
Copy Markdown
Member

@nohwnd nohwnd commented Mar 19, 2026

Integration tests offload work to child processes (vstest.console, testhost), so there is no shared in-process state between test methods in the same class. ClassLevel parallelization was unnecessarily conservative - switching to MethodLevel allows more tests to run concurrently, improving overall test execution time.

Each test method creates its own TempDirectory and invokes vstest.console independently, so concurrent execution within a class is safe.

Fixes #15488

Integration tests offload work to child processes (vstest.console,
testhost), so there is no shared in-process state between methods.
MethodLevel parallelization allows more tests to run concurrently,
improving overall test execution time.

Fixes microsoft#15488

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 19, 2026 17:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Switches MSTest integration/acceptance test parallelization from class-level to method-level to increase concurrency and reduce overall test runtime, based on the fact that most work is executed in child processes.

Changes:

  • Updated MSTest assembly-level Parallelize scope from ClassLevel to MethodLevel in two integration test assemblies.
  • Expanded comments to document why method-level parallelization is considered safe (child-process isolation).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
test/Microsoft.TestPlatform.Library.IntegrationTests/Properties/AssemblyInfo.cs Changes MSTest parallelization scope to MethodLevel and documents rationale.
test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Properties/AssemblyInfo.cs Same parallelization scope change for acceptance integration tests.

Blame tests collect crash/hang dumps from child processes and race
when run in parallel at method level, causing dump files to be missed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

[TestClass]
[TestCategory("Windows-Review")]
[DoNotParallelize] // Blame tests collect crash/hang dumps from child processes and race when run in parallel.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Dubious claim, needs more proof. #15530

@nohwnd nohwnd added the 🚢 Ship it! Add to PRs where owner approves automated PR, but cannot approve because they "wrote it". label Mar 20, 2026
@nohwnd nohwnd enabled auto-merge (squash) March 20, 2026 08:33
@nohwnd nohwnd merged commit e57c44d into microsoft:main Mar 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚢 Ship it! Add to PRs where owner approves automated PR, but cannot approve because they "wrote it".

Projects

None yet

Development

Successfully merging this pull request may close these issues.

integration tests parallelize on class level

3 participants