Repository navigation
Fix SkipOnCoreClr generating unreachable test code in standalone runner - #126517
Merged
Merged
Conversation
SkipOnCoreClrAttribute handling in XUnitWrapperGenerator initialized skippedTestPlatforms, skippedConfigurations, and skippedTestModes to their respective .Any values. When the attribute only specified one dimension (e.g., RuntimeTestModes.InterpreterActive), the others remained at Any. This caused DecorateWithSkipOnCoreClrConfiguration to compute targetPlatform & ~Any = 0, which produced a literal (false) platform condition, making the test body unreachable dead code. The standalone runner would return 100 (pass) without ever executing the test. Fix by initializing the defaults to 0 (meaning 'not specified'), and updating the 'no args given' check accordingly. Now unspecified dimensions correctly mean 'don't skip'. Co-authored-by: Copilot <[email protected]>
Member
Author
|
/azp run runtime-nativeaot-outerloop, runtime-coreclr outerloop |
|
Azure Pipelines successfully started running 2 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes SkipOnCoreClrAttribute handling in the XUnit wrapper source generator so that specifying only one skip “dimension” (e.g., RuntimeTestModes.InterpreterActive) no longer results in a false platform condition that makes the generated test body unreachable in the standalone runner.
Changes:
- Initialize
skippedTestPlatforms,skippedConfigurations, andskippedTestModesto0(meaning “unspecified”) instead ofAny. - Update the “no args given” check to detect the new
0-initialized state and preserve the intended “skip all CoreCLR” behavior only when no dimensions are provided.
jkoritzinsky
approved these changes
Apr 3, 2026
Mark test as active issue due to dependency on marshalled calli.
Member
Author
|
/azp run runtime-nativeaot-outerloop, runtime-coreclr outerloop |
|
Azure Pipelines successfully started running 2 pipeline(s). |
Member
Author
|
/azp run runtime-nativeaot-outerloop, runtime-coreclr outerloop |
|
Azure Pipelines successfully started running 2 pipeline(s). |
jkoritzinsky
approved these changes
Apr 6, 2026
AaronRobinsonMSFT
approved these changes
Apr 7, 2026
Member
Author
|
/azp run runtime-nativeaot-outerloop, runtime-coreclr outerloop |
|
Azure Pipelines successfully started running 2 pipeline(s). |
Member
Author
|
/ba-g failure building DNNE that looks like an infra hiccup, networking test, and #122345, all unrelated |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Noticed this when my agent started marking ActiveIssue'd native AOT tests as working. The tests clearly shouldn't pass but they did. See #126499 that makes a test fail and we get a green CI without this commit (and fail with this commit).
SkipOnCoreClrAttribute handling in XUnitWrapperGenerator initialized skippedTestPlatforms, skippedConfigurations, and skippedTestModes to their respective .Any values. When the attribute only specified one dimension (e.g., RuntimeTestModes.InterpreterActive), the others remained at Any. This caused DecorateWithSkipOnCoreClrConfiguration to compute targetPlatform & ~Any = 0, which produced a literal (false) platform condition, making the test body unreachable dead code. The standalone runner would return 100 (pass) without ever executing the test.
Fix by initializing the defaults to 0 (meaning 'not specified'), and updating the 'no args given' check accordingly. Now unspecified dimensions correctly mean 'don't skip'.