Skip to content

Improve GC allocation failure diagnostics - #133484

Merged
mrek-msft merged 1 commit into
mainfrom
copilot/investigate-test-failure-131629
Sep 11, 2026
Merged

mrek-msft merged 1 commit into
mainfrom
copilot/investigate-test-failure-131629

Conversation

Copilot AI commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Improve the allocation regression test’s exception output so failures reveal what happened inside the test instead of only reporting the allocation size.

  • Capture the thrown exception.
  • Include its type, message, and stack trace in the diagnostic output.
catch (Exception ex)
{
    Console.WriteLine($"Unexpected exception when allocating {bytesToAlloc} bytes: {ex}");
    ret = -1;
}

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions github-actions Bot added the area-ExceptionHandling-coreclr only use for closed issues label Sep 9, 2026
@mrek-msft
mrek-msft marked this pull request as ready for review September 9, 2026 12:47
Copilot AI lite review requested due to automatic review settings September 9, 2026 12:47
@mrek-msft mrek-msft added area-GC-coreclr and removed area-ExceptionHandling-coreclr only use for closed issues labels Sep 9, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @anicka-net, @dotnet/gc
See info in area-owners.md if you want to be subscribed.

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.

🟢 Approval recommended

The change is localized to test diagnostics, compiles cleanly, and improves failure visibility without altering the test’s pass/fail logic.

Pull request overview

This PR improves diagnostics in the GC allocation regression test by including full exception details in the failure output, making allocation failures easier to debug from CI logs.

Changes:

  • Capture the thrown exception in the allocation loop.
  • Print the exception via interpolated string formatting so the output includes exception type, message, and stack trace (ex.ToString()).
File summaries
File Description
src/tests/GC/Regressions/v2.0-rtm/544701/544701.cs Enhance allocation failure logging by printing the captured exception details.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

@mrek-msft
mrek-msft merged commit 3884b33 into main Sep 11, 2026
96 checks passed
@mrek-msft
mrek-msft deleted the copilot/investigate-test-failure-131629 branch September 11, 2026 10:26
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 14, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants