Skip to content

Fail inner build when running coreclr tests#124767

Merged
jtschuster merged 4 commits intodotnet:mainfrom
jtschuster:fix-stale-test-results
Feb 24, 2026
Merged

Fail inner build when running coreclr tests#124767
jtschuster merged 4 commits intodotnet:mainfrom
jtschuster:fix-stale-test-results

Conversation

@jtschuster
Copy link
Member

When a test run crashes, the msbuild build would still succeed, and run.py would read stale testRun.xml files from a previous run, reporting old (potentiall passing) results instead of an error. Instead use ContinueOnError="ErrorAndContinue" to allow subsequent test runs to continue but still fail the build.

jtschuster and others added 4 commits February 23, 2026 10:57
When a test run crashes, run.py would read stale testRun.xml files from
a previous run, reporting old passing results instead of an error.

Fix by:
1. Deleting old test result files before running tests.
2. Returning failure (exit code 1) when tests were run but no result
   files were produced, indicating the run likely crashed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @agocke, @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

Copy link
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

This PR fixes a critical issue in CoreCLR test execution where test failures or crashes would incorrectly be reported as successes, causing run.py to read stale test results from previous runs. The fix changes the MSBuild Exec tasks from using IgnoreExitCode="true" to ContinueOnError="ErrorAndContinue", ensuring that while all tests continue to run in parallel, the build correctly fails if any test fails or crashes.

Changes:

  • Modified test execution to fail the build on test failures while still allowing all tests to run to completion
  • Removed redundant error message logging (MSBuild's built-in error reporting is more comprehensive)
  • Improved code consistency with minor formatting adjustments

@jtschuster jtschuster merged commit 19db7ab into dotnet:main Feb 24, 2026
88 checks passed
@github-project-automation github-project-automation bot moved this to Done in AppModel Feb 24, 2026
iremyux pushed a commit to iremyux/dotnet-runtime that referenced this pull request Mar 2, 2026
When a test run crashes, the msbuild build would still succeed, and
run.py would read stale testRun.xml files from a previous run, reporting
old (potentiall passing) results instead of an error. Instead use
`ContinueOnError="ErrorAndContinue"` to allow subsequent test runs to
continue but still fail the build.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants