Split TimeoutTests into separate classes with single asset each#7580
Merged
Evangelink merged 2 commits intomainfrom Mar 20, 2026
Merged
Split TimeoutTests into separate classes with single asset each#7580Evangelink merged 2 commits intomainfrom
Evangelink merged 2 commits intomainfrom
Conversation
… each Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issue with multiple test assets in single test class
Split TimeoutTests into separate classes with single asset each
Mar 20, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the MSTest acceptance timeout integration tests to ensure each test class generates/builds only a single test asset, improving parallelism and reducing unnecessary asset builds during class initialization.
Changes:
- Split the former multi-asset
TimeoutTestssuite into multiple single-asset test classes. - Kept
TimeoutTests.csfocused on CLI--timeoutparsing/behavior tests with a singleTimeoutTestasset. - Introduced dedicated classes/assets for timeout expiration, test-context cancellation, runsettings-based timeouts, cooperative cancellation, and method-level timeout scenarios.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTests.cs | Reduced to the 5 CLI --timeout extension tests and a single TimeoutTest asset. |
| test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutWhenCanceledTests.cs | New single-asset class covering *_WhenTestContextCanceled_* scenarios. |
| test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutWhenExpiresTests.cs | New single-asset class covering *_WhenTimeoutExpires_* + attribute precedence scenarios. |
| test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutFromRunSettingsTests.cs | New single-asset class covering runsettings-driven timeout behavior. |
| test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutCooperativeCancellationTests.cs | New single-asset class covering cooperative cancellation lifecycle timeout behavior. |
| test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTestMethodTests.cs | New single-asset class covering [Timeout(1000)] on test method scenarios. |
| test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutCooperativeTestMethodTests.cs | New single-asset class covering [Timeout(1000, CooperativeCancellation = true)] on test method scenarios. |
Evangelink
approved these changes
Mar 20, 2026
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.
TimeoutTestshad 7 assets in a singleGetAssetsToGenerateoverride, causing all assets to build during class initialization regardless of which tests run — blocking parallelism and wasting build time.Changes
TimeoutTests.cs— stripped to only the 5 CLI--timeoutextension tests (asset:TimeoutTest)TimeoutWhenCanceledTests.cs—*_WhenTestContextCanceled_*tests (asset: 60s timeout lifecycle project)TimeoutWhenExpiresTests.cs—*_WhenTimeoutExpires_*and*_AttributeTakesPrecedencetests (asset: 1s timeout lifecycle project)TimeoutFromRunSettingsTests.cs—*_FromRunSettings_*tests (asset: no-timeout lifecycle project)TimeoutCooperativeCancellationTests.cs—CooperativeCancellation_*tests (asset: cooperative cancellation lifecycle project)TimeoutTestMethodTests.cs—Timeout_WhenMethodTimeout*tests (asset:[Timeout(1000)]on test method)TimeoutCooperativeTestMethodTests.cs—CooperativeTimeout_WhenMethodTimeout*tests (asset:[Timeout(1000, CooperativeCancellation = true)]on test method)RunAndAssertWithRunSettingsAsync(which previously branched on two assets) was split intoRunAndAssertAttributeTakesPrecedenceAsyncandRunAndAssertFromRunSettingsAsync, each living in the class that owns the relevant asset.Original prompt
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.