Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Reduce excessive test output in CI/Helix logs - #54782

#54782
Merged
marcpopMSFT merged 5 commits into
maindotnet/sdk:mainfrom
marcppMSFT-reducetestoutputdotnet/sdk:marcppMSFT-reducetestoutputCopy head branch name to clipboard
Jun 17, 2026
Merged

Reduce excessive test output in CI/Helix logs#54782
marcpopMSFT merged 5 commits into
maindotnet/sdk:mainfrom
marcppMSFT-reducetestoutputdotnet/sdk:marcppMSFT-reducetestoutputCopy head branch name to clipboard

Conversation

@marcpopMSFT

Copy link
Copy Markdown
Member

Summary

Reduces the volume of test output in Helix console logs, making it significantly easier to find [fail] markers and reducing costs for both human reviewers and agent-based log analysis.

Problem

Helix console logs for PR builds were excessively large, making test failure investigation difficult. The root cause was not MSBuild diagnostic-level builds (CI defaults to \minimal\ verbosity), but rather the test framework itself logging too aggressively.

Changes

1. Disable xUnit diagnostic output (high impact)

  • Set \diagnosticMessages: false\ and \showLiveOutput: false\ in \ est/xunit.runner.json\
  • Set \xunit.diagnosticMessages: false\ in \ est/dotnet.Tests/app.config\
  • These were emitting xUnit internal chatter (assembly discovery, test case enumeration, timing) for every test

2. Buffer TestCommand output — only dump on failure (highest impact)

  • \TestCommand.Execute()\ now buffers stdout/stderr lines instead of logging them in real-time
  • On failure: full output is dumped to test logs (same as before)
  • On success: a single summary line shows how many lines were suppressed
  • Set \DOTNET_SDK_TEST_VERBOSE=1\ to restore original real-time logging for local debugging

3. Remove -v:diag\ retry on NU3003 (medium impact)

  • \MSBuildCommand.Execute()\ previously re-ran the entire build with -v:diag\ when NU3003 (signature verification) was encountered
  • This produced 5000+ lines of output when triggered
  • Now retries without verbosity escalation — the binlog (already uploaded to Helix) contains full diagnostic-level data

4. Raise XunitLoggerProvider minimum log level (moderate impact)

  • Changed default from \Trace\ to \Information\
  • Eliminates Debug/Trace-level Microsoft.Extensions.Logging noise from test output
  • Callers can still pass a lower level explicitly when needed

Not included (follow-up)

  • ~33 instances across 18 test files that explicitly pass -v:normal\ or /v:normal\ instead of -v:minimal\ — lower priority, can be audited in a separate PR

- Disable xUnit diagnosticMessages and showLiveOutput in xunit.runner.json
  and dotnet.Tests/app.config to eliminate internal xUnit chatter
- Buffer TestCommand stdout/stderr and only dump on failure; on success,
  log a single summary line with suppressed line counts
- Remove -v:diag verbosity escalation on NU3003 in MSBuildCommand; the
  binlog (already uploaded to Helix) provides full diagnostic data
- Raise XunitLoggerProvider default log level from Trace to Information

Set DOTNET_SDK_TEST_VERBOSE=1 to restore full real-time output for local
debugging.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 15, 2026 23:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 reduces excessive Helix/CI test log volume by disabling xUnit diagnostic/live output, buffering command output so it’s only emitted on failure by default, and avoiding MSBuild verbosity escalation retries.

Changes:

  • Turn off xUnit diagnostic messages and live output to reduce baseline noise.
  • Buffer TestCommand stdout/stderr and only dump it on failures (opt-in verbose streaming via DOTNET_SDK_TEST_VERBOSE=1).
  • Stop re-running MSBuild with -v:diag on NU3003, relying on uploaded binlogs instead; raise XunitLoggerProvider default minimum log level.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/xunit.runner.json Disables xUnit diagnostic messages and live output globally.
test/dotnet.Tests/app.config Disables xUnit diagnostic messages for dotnet.Tests.
test/Microsoft.NET.TestFramework/Commands/TestCommand.cs Buffers process output and suppresses it on success unless verbose mode is enabled.
test/Microsoft.NET.TestFramework/Commands/MSBuildCommand.cs Removes -v:diag retry escalation on NU3003 and logs guidance to use binlogs.
test/Microsoft.NET.TestFramework/XunitLoggerProvider.cs Raises default ILogger minimum level to Information to reduce logging noise.

Comment thread test/Microsoft.NET.TestFramework/Commands/TestCommand.cs Outdated
PowerShell script that queries AzDO build timelines to extract Helix job IDs,
then uses HTTP HEAD against console log blob URLs to measure log sizes without
downloading them. Supports single-build analysis and side-by-side comparison
of two builds. Outputs top-N largest work items and optional CSV export.

Usage:
  # Single build analysis
  .\scripts\helix-log-sizes.ps1 -BaselineBuildId 1465148

  # Compare baseline vs PR build
  .\scripts\helix-log-sizes.ps1 -BaselineBuildId 1465148 -ComparisonBuildId <new>

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

Copy link
Copy Markdown
Member Author

I picked a passing build against main and had copilot do a data analysis of the log file size as I suspect that this will not be enough. Either way, we're definitely making it hard for a human to investigate and wasting copilot resources digging through gigantic log files.

image

@MichaelSimons

Copy link
Copy Markdown
Member
  1. Buffer TestCommand output — only dump on failure (highest impact)

This assumes failures only occur when a command fails. This is not always the case, the test can expect the command to produce different results/output. Suppressing the output in these scenarios could make it difficult to diagnose failures without reproducing locally and enabling DOTNET_SDK_TEST_VERBOSE. If this proves to be a common occurrence, we may want to add API support for enabling the verbose output on the TestCommand so the test can opt in.

Comment thread test/Microsoft.NET.TestFramework/Commands/MSBuildCommand.cs Outdated
@MichaelSimons

Copy link
Copy Markdown
Member

@marcpopMSFT, @dsplaisted - How do you see this PR integrating with #54795?

@dsplaisted

Copy link
Copy Markdown
Member

@marcpopMSFT, @dsplaisted - How do you see this PR integrating with #54795?

#54795 is against 9.0.1xx, where the test logging infrastructure is slightly different. So probably we could take that for 9.0 and this one for main.

…t API, clean up comments

- Remove duplicate List<string> buffering; use result.StdOut/StdErr
  (already captured by CaptureStdOut/CaptureStdErr) to dump output on
  failure, avoiding doubled memory pressure in CI
- Add TestCommand.VerboseOutput property so individual tests can opt
  into real-time output streaming without requiring the global env var
- Rewrite NU3003 comment and log message to not reference old behavior
- Ensure CommandOutputHandler is still invoked in non-verbose mode

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

Copy link
Copy Markdown
Member Author

Copilot analysis of the improvements from this PR, looks like it provided significant log file reduction.
image

String.Split(string) is not available on .NET Framework. Use
String.Split(string[], StringSplitOptions) instead.

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

Copy link
Copy Markdown
Member Author

Final results for this PR:
image

@marcpopMSFT
marcpopMSFT merged commit d56cc31 into main Jun 17, 2026
25 checks passed
@marcpopMSFT
marcpopMSFT deleted the marcppMSFT-reducetestoutput branch June 17, 2026 20:38
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.