From c9ff4496659d452bb4c28c788ad9aa89b4e556ee Mon Sep 17 00:00:00 2001 From: Kevin Jones Date: Tue, 5 Aug 2025 12:30:11 -0400 Subject: [PATCH] Remove 2GB allocations from MemoryStream_SeekOverflow_Throws. This test was allocating arrays that were nearly 2GB in size in order to attempt to test an edge case around seek overflowing. These large allocations are very unable in CI and started failing for Android + CoreCLR. The test is already disabled for Linux, for iOS, for tvOS, and partially for Windows. Rather than disable it yet again, let's just not test the very large allocation sizes. At this point the test has been disabled on so many platforms for being problematic we aren't getting much value from the large allocations. --- .../System.IO.Tests/MemoryStream/MemoryStreamTests.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/libraries/System.Runtime/tests/System.IO.Tests/MemoryStream/MemoryStreamTests.cs b/src/libraries/System.Runtime/tests/System.IO.Tests/MemoryStream/MemoryStreamTests.cs index ae2961f111a2dd..23d4b88c3da8d2 100644 --- a/src/libraries/System.Runtime/tests/System.IO.Tests/MemoryStream/MemoryStreamTests.cs +++ b/src/libraries/System.Runtime/tests/System.IO.Tests/MemoryStream/MemoryStreamTests.cs @@ -95,16 +95,11 @@ from bufferContext in (10, 0), (10, 5), (10, 10), - (Array.MaxLength, 0), - (Array.MaxLength, Array.MaxLength) } select new object[] {mode, bufferContext.bufferSize, bufferContext.origin}; - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.Is64BitProcess))] + [Theory] [MemberData(nameof(MemoryStream_PositionOverflow_Throws_MemberData))] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "https://github.com/dotnet/runtime/issues/92467")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/100225", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsWindows), nameof(PlatformDetection.IsX64Process))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/100558", TestPlatforms.Linux)] public void MemoryStream_SeekOverflow_Throws(SeekMode mode, int bufferSize, int origin) { byte[] buffer = new byte[bufferSize];