Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 20, 2025

  • Locate and examine the failing tests in Utf8JsonWriterTests.cs
  • Add OuterLoop and ConditionalFact(64-bit only) attributes to WritePropertyWithExtremelyLongName_ThrowsArgumentException
  • Add OuterLoop and ConditionalFact(64-bit only) attributes to WriteValueWithExtremelyLongValue_ThrowsArgumentException
  • Verify the changes follow the existing pattern in the file
  • Build and test the System.Text.Json library
  • Confirm tests compile successfully
  • Update to use PlatformDetection.Is64BitProcess instead of Environment.Is64BitProcess
Original prompt

This section details on the original issue you should resolve

<issue_title>Utf8JsonWriterTests.WriteValueWithExtremelyLongValue_ThrowsArgumentException test fails with OutOfMemoryException</issue_title>
<issue_description>## Build Information
Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1180196
Build error leg or test failing: System.Text.Json.Tests.Utf8JsonWriterTests.WritePropertyWithExtremelyLongName_ThrowsArgumentException
Pull request: #120858

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": ["System.Text.Json.Tests.Utf8JsonWriterTests.WriteValueWithExtremelyLongValue_ThrowsArgumentException","OutOfMemoryException"],
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1180196
Error message validated: [System.Text.Json.Tests.Utf8JsonWriterTests.WriteValueWithExtremelyLongValue_ThrowsArgumentException OutOfMemoryException]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 10/20/2025 9:30:10 PM UTC

Report

Build Definition Test Pull Request
1180337 dotnet/runtime System.Text.Json.Tests.Utf8JsonWriterTests.WritePropertyWithExtremelyLongName_ThrowsArgumentException #120917
1180312 dotnet/runtime System.Text.Json.Tests.Utf8JsonWriterTests.WritePropertyWithExtremelyLongName_ThrowsArgumentException #120041
1180275 dotnet/runtime System.Text.Json.Tests.Utf8JsonWriterTests.WriteValueWithExtremelyLongValue_ThrowsArgumentException #120272
1180196 dotnet/runtime System.Text.Json.Tests.Utf8JsonWriterTests.WritePropertyWithExtremelyLongName_ThrowsArgumentException #120858

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
4 4 4

<agent_instructions>Please mark this test for outerloop and 64-bit only</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@jkotas Regression introduced by #120731

cc @eiriktsarpalis @stephentoub </comment_new>

Fixes #120918


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI self-assigned this Oct 20, 2025
Copilot AI changed the title [WIP] Fix OutOfMemoryException in Utf8JsonWriterTests Mark memory-intensive Utf8JsonWriterTests for OuterLoop and 64-bit only Oct 20, 2025
Copilot AI requested a review from stephentoub October 20, 2025 23:47
Copilot finished work on behalf of stephentoub October 20, 2025 23:47
@stephentoub stephentoub marked this pull request as ready for review October 21, 2025 00:48
Copilot AI review requested due to automatic review settings October 21, 2025 00:48
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 addresses OutOfMemoryException failures in two Utf8JsonWriter tests by restricting them to run only in 64-bit outer loop scenarios. Both tests allocate extremely large strings (170 million characters) which can exhaust memory in resource-constrained environments or 32-bit processes.

Key changes:

  • Added [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] to ensure tests only run on 64-bit processes
  • Added [OuterLoop] attribute to move tests out of default CI runs

Copilot AI requested a review from stephentoub October 21, 2025 01:10
Copilot finished work on behalf of stephentoub October 21, 2025 01:10
@jkotas jkotas enabled auto-merge (squash) October 21, 2025 01:27
@jkotas jkotas merged commit 402d735 into main Oct 21, 2025
85 checks passed
@eiriktsarpalis eiriktsarpalis deleted the copilot/fix-outofmemory-exception-test branch October 21, 2025 06:16
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.

Utf8JsonWriterTests.WriteValueWithExtremelyLongValue_ThrowsArgumentException test fails with OutOfMemoryException

4 participants