Repository navigation
Ignore MTP exit code 8 (zero tests ran) for Helix work items - #54965
Merged
Merged
Conversation
MSTest.Sdk-based (MTP) test projects fail Helix work items with exit code 8 when a shard runs zero tests -- either because class-based sharding isolates only skipped tests, or because a project legitimately runs no tests on a given platform (e.g. Windows-only Msi tests on Linux/macOS). Helix treats the nonzero exit as a failure even though the test results report green, which is confusing and has led to PRs being merged in a falsely-failing state. Add --ignore-exit-code 8 to the MTP work-item command so these runs report success. Real failures (exit 2, crashes, etc.) still surface. Fixes #54963 Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Helix work item command line for Microsoft.Testing.Platform (MTP) / MSTest.Sdk test assemblies so that MTP’s “zero tests ran” exit code (8) is treated as success, avoiding false-negative Helix failures when sharding or platform-specific skips result in zero executed tests.
Changes:
- Add
--ignore-exit-code 8to the MTP work item invocation. - Document the rationale and link to the tracking issue (#54963) inline in the task.
Show a summary per file
| File | Description |
|---|---|
| test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs | Adds --ignore-exit-code 8 to MTP work item commands to prevent Helix failures when a shard runs zero tests. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
Evangelink
enabled auto-merge
June 24, 2026 18:22
MichaelSimons
approved these changes
Jun 24, 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.
Problem
Some Helix work items fail with exit code 8 even though the test results tab shows everything green, which is confusing and has led to PRs being merged in a falsely-failing state (see #54963, #54788).
Exit code
8in Microsoft.Testing.Platform (MTP) means "the test session ran zero tests".Root cause
The affected assemblies (
dotnet-aot.Tests,Microsoft.Win32.Msi.Tests, …) are allMSTest.Sdk→ MTP projects. They run through theisMTPProjectbranch inSDKCustomCreateXUnitWorkItemsWithTestExclusion, invoked asdotnet exec <dll> --filter ....A work item ends up running zero tests when:
--filter) isolates a partition containing only skipped tests, orMTP then returns exit code 8 and Helix treats the nonzero exit as a failure.
Fix
Add
--ignore-exit-code 8to the MTP work-item command so "zero tests ran" reports success instead of failing the work item. This is the mitigation called out in the issue.dotnet testpath doesn't use MTP exit codes and is untouched.The stricter long-term fix (relaxing exit 8 on the test-platform side when tests exist but are all skipped) is tracked separately.
Fixes #54963