You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
System.Formats.Nrbf.Tests.EdgeCaseTests.CanReadArrayOfAnySize times out on checked coreclr #125994
System.Formats.Nrbf.Tests.EdgeCaseTests.CanReadArrayOfAnySize times out after 14+ minutes on the checked coreclr windows x64 Release leg. The test runs as a long-running test until the Helix work item is killed.
The 2 GB case (Array.MaxLength = 2,147,483,591) only runs in RELEASE + NET builds. The failing leg is Libraries Test Run checked coreclr windows x64 Release — so the test libraries are built as Release (the #if RELEASE is active), but it runs on checked coreclr (debug assertions enabled in the runtime).
The test allocates a 2 GB byte[], fills it with random data, serializes via BinaryFormatter to a temp file, then deserializes with NrbfDecoder.Decode() and calls Assert.Equal on the entire array. On checked coreclr, the runtime's debug assertions and extra validation massively slow down operations on huge arrays. The Helix log shows the test running for 14+ minutes with xUnit flagging it as [Long Running Test] at 2-minute intervals until the work item is killed at ~15.5 min.
This only manifests on checked coreclr because:
The #if RELEASE guard enables the 2 GB test case for Release library builds
But the runtime is a checked build (with expensive assertions/validation)
The combination of "test is enabled" + "runtime is slow" causes the timeout
On release coreclr this test presumably completes in time. On Debug library builds, the 2 GB case is #if'd out.
The above doesn't explain why this suddenly started happening as the code/tests didn't change for this library.
We should probably try adding [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.Is64BitProcess), nameof(PlatformDetection.IsReleaseRuntime))]
Activity
lewing commentedon Mar 23, 2026
cc @adamsitnik
danmoseley commentedon Mar 24, 2026
Note
This analysis was performed by Copilot.
The test has these
[InlineData]cases:The 2 GB case (
Array.MaxLength = 2,147,483,591) only runs inRELEASE+NETbuilds. The failing leg isLibraries Test Run checked coreclr windows x64 Release— so the test libraries are built as Release (the#if RELEASEis active), but it runs on checked coreclr (debug assertions enabled in the runtime).The test allocates a 2 GB
byte[], fills it with random data, serializes viaBinaryFormatterto a temp file, then deserializes withNrbfDecoder.Decode()and callsAssert.Equalon the entire array. On checked coreclr, the runtime's debug assertions and extra validation massively slow down operations on huge arrays. The Helix log shows the test running for 14+ minutes with xUnit flagging it as[Long Running Test]at 2-minute intervals until the work item is killed at ~15.5 min.This only manifests on checked coreclr because:
#if RELEASEguard enables the 2 GB test case for Release library buildsOn release coreclr this test presumably completes in time. On Debug library builds, the 2 GB case is
#if'd out.danmoseley commentedon Mar 24, 2026
The above doesn't explain why this suddenly started happening as the code/tests didn't change for this library.
We should probably try adding
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.Is64BitProcess), nameof(PlatformDetection.IsReleaseRuntime))]matouskozak commentedon Mar 25, 2026
This is failing on Mono as well https://dev.azure.com/dnceng-public/public/_build/results?buildId=1347806&view=logs&j=e0d511fe-956d-5b24-aafc-28f46ef4907e&t=27018d23-2eea-54b6-a572-4bc099d6ce9d&s=ff05ad62-bb9a-53b6-ce9f-72f329a63e7c
Fix CanReadArrayOfAnySize timeout on checked coreclr by skipping the …
NRBF test fix: we need optimized library (#126189)