From 8565792e836bcb1baba2da9fc6e86cbf12ce4720 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 20 May 2026 17:32:51 +0200 Subject: [PATCH 01/10] [clr-ios] Fix mobile CoreCLR test failures across libraries Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/UnitTests/Internal/HostTests.cs | 16 ++++++++-------- .../ExpressionDebuggerTypeProxyTests.cs | 2 +- .../tests/FunctionalTests/NetworkStreamTest.cs | 5 +++++ .../Decoding/CustomAttributeDecoderTests.cs | 2 +- .../tests/TpaLoadFailureTest.cs | 4 ++-- .../tests/CryptoStream.cs | 4 ++++ 6 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/Internal/HostTests.cs b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/Internal/HostTests.cs index c345548c3a44c3..3d50b7c489fa02 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/Internal/HostTests.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/Internal/HostTests.cs @@ -593,7 +593,7 @@ public async Task HostShutsDownWhenTokenTriggers() } // Moq heavily utilizes RefEmit, which does not work on most aot workloads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] public async Task HostStopAsyncCanBeCancelledEarly() { var service = new Mock(); @@ -625,7 +625,7 @@ public async Task HostStopAsyncCanBeCancelledEarly() } // Moq heavily utilizes RefEmit, which does not work on most aot workloads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] public async Task HostStopAsyncUsesDefaultTimeoutIfGivenTokenDoesNotFire() { var service = new Mock(); @@ -658,7 +658,7 @@ public async Task HostStopAsyncUsesDefaultTimeoutIfGivenTokenDoesNotFire() } // Moq heavily utilizes RefEmit, which does not work on most aot workloads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] public async Task WebHostStopAsyncUsesDefaultTimeoutIfNoTokenProvided() { var service = new Mock(); @@ -1215,7 +1215,7 @@ public async Task Host_InvokesConfigureServicesMethodsOnlyOnce() } // Moq heavily utilizes RefEmit, which does not work on most aot workloads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] public void Dispose_DisposesAppConfigurationProviders() { var providerMock = new Mock().As(); @@ -1240,7 +1240,7 @@ public void Dispose_DisposesAppConfigurationProviders() } // Moq heavily utilizes RefEmit, which does not work on most aot workloads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] public void Dispose_DisposesHostConfigurationProviders() { var providerMock = new Mock().As(); @@ -1316,7 +1316,7 @@ public async Task HostCallsDisposeAsyncOnServiceProviderWhenDisposeAsyncCalled() } // Moq heavily utilizes RefEmit, which does not work on most aot workloads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] public async Task DisposeAsync_DisposesAppConfigurationProviders() { var providerMock = new Mock().As(); @@ -1341,7 +1341,7 @@ public async Task DisposeAsync_DisposesAppConfigurationProviders() } // Moq heavily utilizes RefEmit, which does not work on most aot workloads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] public async Task DisposeAsync_DisposesHostConfigurationProviders() { var providerMock = new Mock().As(); @@ -1366,7 +1366,7 @@ public async Task DisposeAsync_DisposesHostConfigurationProviders() } // Moq heavily utilizes RefEmit, which does not work on most aot workloads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] public void ThrowExceptionForCustomImplementationOfIHostApplicationLifetime() { var hostApplicationLifetimeMock = new Mock(); diff --git a/src/libraries/System.Linq.Expressions/tests/DebuggerTypeProxy/ExpressionDebuggerTypeProxyTests.cs b/src/libraries/System.Linq.Expressions/tests/DebuggerTypeProxy/ExpressionDebuggerTypeProxyTests.cs index 4d64e4bc19ac2b..df349e4bf0dd3f 100644 --- a/src/libraries/System.Linq.Expressions/tests/DebuggerTypeProxy/ExpressionDebuggerTypeProxyTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/DebuggerTypeProxy/ExpressionDebuggerTypeProxyTests.cs @@ -163,7 +163,7 @@ public void VerifyDebugView(object obj) } } - [ConditionalTheory, MemberData(nameof(OnePerType))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNativeAot)), MemberData(nameof(OnePerType))] public void ThrowOnNullToCtor(object sourceObject) { Type type = sourceObject.GetType(); diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs index 63b862f355b39a..d497b969e91079 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs @@ -43,6 +43,11 @@ public void Ctor_NullSocket_ThrowsArgumentNullExceptions() AssertExtensions.Throws("socket", () => new NetworkStream(null, FileAccess.ReadWrite, false)); } + [Theory] + [MemberData(nameof(CopyToAsync_AllDataCopied_MemberData), MemberType = typeof(ConnectedStreamConformanceTests))] + public override Task CopyToAsync_AllDataCopied(int byteCount, bool useAsync) => + base.CopyToAsync_AllDataCopied(byteCount, useAsync); + [Fact] public void Ctor_NotConnected_Throws() { diff --git a/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/CustomAttributeDecoderTests.cs b/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/CustomAttributeDecoderTests.cs index 0b7055dc65a04e..8c82fa714af030 100644 --- a/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/CustomAttributeDecoderTests.cs +++ b/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/CustomAttributeDecoderTests.cs @@ -200,7 +200,7 @@ public void TestCustomAttributeDecoderUsingReflection() #if NET && !TARGET_BROWSER // Generic attribute is not supported on .NET Framework. [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/60579", TestPlatforms.iOS | TestPlatforms.tvOS)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60579", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void TestCustomAttributeDecoderGenericUsingReflection() { Type type = typeof(HasGenericAttributes); diff --git a/src/libraries/System.Runtime.Loader/tests/TpaLoadFailureTest.cs b/src/libraries/System.Runtime.Loader/tests/TpaLoadFailureTest.cs index dc6ca9b84e7904..7691eccf9b3d95 100644 --- a/src/libraries/System.Runtime.Loader/tests/TpaLoadFailureTest.cs +++ b/src/libraries/System.Runtime.Loader/tests/TpaLoadFailureTest.cs @@ -24,7 +24,7 @@ private static string GetAssemblyPath(string assemblyName) [MethodImpl(MethodImplOptions.NoInlining)] private static string UseCorruptAssembly() => BindFailureTest.Corrupt.TestClass.GetMessage(); - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCoreCLR), nameof(PlatformDetection.HasAssemblyFiles))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCoreCLR), nameof(PlatformDetection.HasAssemblyFiles), nameof(PlatformDetection.IsNotAppleMobile))] public void NotFound_ExceptionContainsAssemblyPath() { // The Missing assembly is listed in deps.json (so the host adds it to the TPA @@ -71,7 +71,7 @@ public void SharingViolation_ExceptionContainsPathAndHResult() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCoreCLR), nameof(PlatformDetection.HasAssemblyFiles))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCoreCLR), nameof(PlatformDetection.HasAssemblyFiles), nameof(PlatformDetection.IsNotAppleMobile))] public void Corrupt_ExceptionContainsPathAndHResult() { const int COR_E_ASSEMBLYEXPECTED = unchecked((int)0x80131018); diff --git a/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs b/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs index 9b6a368769033b..6a2ca77408f499 100644 --- a/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs +++ b/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs @@ -35,6 +35,10 @@ protected override Task CreateWrappedConnectedStreamsAsync(StreamPai [MemberData(nameof(ReadWrite_Success_Large_MemberData))] public override Task ReadWrite_Success_Large(ReadWriteMode mode, int writeSize, bool startWithFlush) => base.ReadWrite_Success_Large(mode, writeSize, startWithFlush); + [Theory] + [MemberData(nameof(ReadWrite_Success_MemberData), MemberType = typeof(ConnectedStreamConformanceTests))] + public override Task ReadWrite_Success(ReadWriteMode mode, int writeSize, bool startWithFlush) => base.ReadWrite_Success(mode, writeSize, startWithFlush); + [Fact] public static void Ctor() { From c3434f7d23b64c79af01038a9d1aab8b97425c9f Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 21 May 2026 11:34:07 +0200 Subject: [PATCH 02/10] Anchor MemberData statics against trimmer; restore IsMultithreadingSupported gate The previous override of CopyToAsync_AllDataCopied / ReadWrite_Success used MemberData(MemberType = typeof(ConnectedStreamConformanceTests)) but the referenced static factory methods are not strongly referenced from anywhere, so the trimmer on maccatalyst-arm64 CoreCLR stripped them and xUnit reported "Could not find public static member named 'ReadWrite_Success_MemberData' / 'CopyToAsync_AllDataCopied_MemberData' on ConnectedStreamConformanceTests". Add [DynamicDependency] on the override to keep those statics rooted. Also restore the [ConditionalTheory(IsMultithreadingSupported)] gate on CopyToAsync_AllDataCopied that the override had silently dropped, per the copilot-pr-reviewer comment. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/UnitTests/Internal/HostTests.cs | 16 ++++++++-------- .../ExpressionDebuggerTypeProxyTests.cs | 2 +- .../tests/FunctionalTests/NetworkStreamTest.cs | 7 ++++++- .../Decoding/CustomAttributeDecoderTests.cs | 2 +- .../tests/TpaLoadFailureTest.cs | 4 ++-- .../tests/CryptoStream.cs | 5 +++++ 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/Internal/HostTests.cs b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/Internal/HostTests.cs index 3d50b7c489fa02..c345548c3a44c3 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/Internal/HostTests.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/Internal/HostTests.cs @@ -593,7 +593,7 @@ public async Task HostShutsDownWhenTokenTriggers() } // Moq heavily utilizes RefEmit, which does not work on most aot workloads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public async Task HostStopAsyncCanBeCancelledEarly() { var service = new Mock(); @@ -625,7 +625,7 @@ public async Task HostStopAsyncCanBeCancelledEarly() } // Moq heavily utilizes RefEmit, which does not work on most aot workloads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public async Task HostStopAsyncUsesDefaultTimeoutIfGivenTokenDoesNotFire() { var service = new Mock(); @@ -658,7 +658,7 @@ public async Task HostStopAsyncUsesDefaultTimeoutIfGivenTokenDoesNotFire() } // Moq heavily utilizes RefEmit, which does not work on most aot workloads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public async Task WebHostStopAsyncUsesDefaultTimeoutIfNoTokenProvided() { var service = new Mock(); @@ -1215,7 +1215,7 @@ public async Task Host_InvokesConfigureServicesMethodsOnlyOnce() } // Moq heavily utilizes RefEmit, which does not work on most aot workloads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void Dispose_DisposesAppConfigurationProviders() { var providerMock = new Mock().As(); @@ -1240,7 +1240,7 @@ public void Dispose_DisposesAppConfigurationProviders() } // Moq heavily utilizes RefEmit, which does not work on most aot workloads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void Dispose_DisposesHostConfigurationProviders() { var providerMock = new Mock().As(); @@ -1316,7 +1316,7 @@ public async Task HostCallsDisposeAsyncOnServiceProviderWhenDisposeAsyncCalled() } // Moq heavily utilizes RefEmit, which does not work on most aot workloads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public async Task DisposeAsync_DisposesAppConfigurationProviders() { var providerMock = new Mock().As(); @@ -1341,7 +1341,7 @@ public async Task DisposeAsync_DisposesAppConfigurationProviders() } // Moq heavily utilizes RefEmit, which does not work on most aot workloads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public async Task DisposeAsync_DisposesHostConfigurationProviders() { var providerMock = new Mock().As(); @@ -1366,7 +1366,7 @@ public async Task DisposeAsync_DisposesHostConfigurationProviders() } // Moq heavily utilizes RefEmit, which does not work on most aot workloads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void ThrowExceptionForCustomImplementationOfIHostApplicationLifetime() { var hostApplicationLifetimeMock = new Mock(); diff --git a/src/libraries/System.Linq.Expressions/tests/DebuggerTypeProxy/ExpressionDebuggerTypeProxyTests.cs b/src/libraries/System.Linq.Expressions/tests/DebuggerTypeProxy/ExpressionDebuggerTypeProxyTests.cs index df349e4bf0dd3f..4d64e4bc19ac2b 100644 --- a/src/libraries/System.Linq.Expressions/tests/DebuggerTypeProxy/ExpressionDebuggerTypeProxyTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/DebuggerTypeProxy/ExpressionDebuggerTypeProxyTests.cs @@ -163,7 +163,7 @@ public void VerifyDebugView(object obj) } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNativeAot)), MemberData(nameof(OnePerType))] + [ConditionalTheory, MemberData(nameof(OnePerType))] public void ThrowOnNullToCtor(object sourceObject) { Type type = sourceObject.GetType(); diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs index d497b969e91079..8e609b07e0a664 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs @@ -2,12 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.IO.Tests; using System.Linq; using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; +using Microsoft.DotNet.XUnitExtensions; using Xunit; namespace System.Net.Sockets.Tests @@ -43,8 +45,11 @@ public void Ctor_NullSocket_ThrowsArgumentNullExceptions() AssertExtensions.Throws("socket", () => new NetworkStream(null, FileAccess.ReadWrite, false)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(CopyToAsync_AllDataCopied_MemberData), MemberType = typeof(ConnectedStreamConformanceTests))] + [DynamicDependency(nameof(ConnectedStreamConformanceTests.CopyToAsync_AllDataCopied_MemberData), typeof(ConnectedStreamConformanceTests))] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public override Task CopyToAsync_AllDataCopied(int byteCount, bool useAsync) => base.CopyToAsync_AllDataCopied(byteCount, useAsync); diff --git a/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/CustomAttributeDecoderTests.cs b/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/CustomAttributeDecoderTests.cs index 8c82fa714af030..0b7055dc65a04e 100644 --- a/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/CustomAttributeDecoderTests.cs +++ b/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/CustomAttributeDecoderTests.cs @@ -200,7 +200,7 @@ public void TestCustomAttributeDecoderUsingReflection() #if NET && !TARGET_BROWSER // Generic attribute is not supported on .NET Framework. [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/60579", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60579", TestPlatforms.iOS | TestPlatforms.tvOS)] public void TestCustomAttributeDecoderGenericUsingReflection() { Type type = typeof(HasGenericAttributes); diff --git a/src/libraries/System.Runtime.Loader/tests/TpaLoadFailureTest.cs b/src/libraries/System.Runtime.Loader/tests/TpaLoadFailureTest.cs index 7691eccf9b3d95..dc6ca9b84e7904 100644 --- a/src/libraries/System.Runtime.Loader/tests/TpaLoadFailureTest.cs +++ b/src/libraries/System.Runtime.Loader/tests/TpaLoadFailureTest.cs @@ -24,7 +24,7 @@ private static string GetAssemblyPath(string assemblyName) [MethodImpl(MethodImplOptions.NoInlining)] private static string UseCorruptAssembly() => BindFailureTest.Corrupt.TestClass.GetMessage(); - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCoreCLR), nameof(PlatformDetection.HasAssemblyFiles), nameof(PlatformDetection.IsNotAppleMobile))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCoreCLR), nameof(PlatformDetection.HasAssemblyFiles))] public void NotFound_ExceptionContainsAssemblyPath() { // The Missing assembly is listed in deps.json (so the host adds it to the TPA @@ -71,7 +71,7 @@ public void SharingViolation_ExceptionContainsPathAndHResult() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCoreCLR), nameof(PlatformDetection.HasAssemblyFiles), nameof(PlatformDetection.IsNotAppleMobile))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCoreCLR), nameof(PlatformDetection.HasAssemblyFiles))] public void Corrupt_ExceptionContainsPathAndHResult() { const int COR_E_ASSEMBLYEXPECTED = unchecked((int)0x80131018); diff --git a/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs b/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs index 6a2ca77408f499..f3ba2128f9572a 100644 --- a/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs +++ b/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.IO; using System.IO.Tests; using System.Text; @@ -37,6 +38,10 @@ protected override Task CreateWrappedConnectedStreamsAsync(StreamPai [Theory] [MemberData(nameof(ReadWrite_Success_MemberData), MemberType = typeof(ConnectedStreamConformanceTests))] + [DynamicDependency(nameof(ConnectedStreamConformanceTests.ReadWrite_Success_MemberData), typeof(ConnectedStreamConformanceTests))] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/107981", TestPlatforms.Wasi)] public override Task ReadWrite_Success(ReadWriteMode mode, int writeSize, bool startWithFlush) => base.ReadWrite_Success(mode, writeSize, startWithFlush); [Fact] From 71efae384ec9ad3a55dc4c788593db3a46bdcf3b Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 29 May 2026 17:01:45 +0200 Subject: [PATCH 03/10] Qualify nameof in MemberData with ConnectedStreamConformanceTests Per review suggestion: keep the MemberData and DynamicDependency arguments in sync by using nameof(ConnectedStreamConformanceTests.X) on both attributes, so they stay aligned if a same-named member is later introduced on the derived class. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/FunctionalTests/NetworkStreamTest.cs | 2 +- .../System.Security.Cryptography/tests/CryptoStream.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs index 8e609b07e0a664..ad727a72796646 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs @@ -46,7 +46,7 @@ public void Ctor_NullSocket_ThrowsArgumentNullExceptions() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] - [MemberData(nameof(CopyToAsync_AllDataCopied_MemberData), MemberType = typeof(ConnectedStreamConformanceTests))] + [MemberData(nameof(ConnectedStreamConformanceTests.CopyToAsync_AllDataCopied_MemberData), MemberType = typeof(ConnectedStreamConformanceTests))] [DynamicDependency(nameof(ConnectedStreamConformanceTests.CopyToAsync_AllDataCopied_MemberData), typeof(ConnectedStreamConformanceTests))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] diff --git a/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs b/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs index f3ba2128f9572a..69c29c92c5134c 100644 --- a/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs +++ b/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs @@ -37,7 +37,7 @@ protected override Task CreateWrappedConnectedStreamsAsync(StreamPai public override Task ReadWrite_Success_Large(ReadWriteMode mode, int writeSize, bool startWithFlush) => base.ReadWrite_Success_Large(mode, writeSize, startWithFlush); [Theory] - [MemberData(nameof(ReadWrite_Success_MemberData), MemberType = typeof(ConnectedStreamConformanceTests))] + [MemberData(nameof(ConnectedStreamConformanceTests.ReadWrite_Success_MemberData), MemberType = typeof(ConnectedStreamConformanceTests))] [DynamicDependency(nameof(ConnectedStreamConformanceTests.ReadWrite_Success_MemberData), typeof(ConnectedStreamConformanceTests))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] From 4f51f36dafd109ab109908804d99b7838ffbb3a0 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 29 May 2026 17:06:42 +0200 Subject: [PATCH 04/10] Collapse mobile skip into one SkipOnPlatform; drop wasm/wasi gating Combines the LinuxBionic and iOS|tvOS skips on the overrides into a single SkipOnPlatform covering the mobile platforms that block AF_UNIX binding. Drops the Wasi ActiveIssue and the IsMultithreadingSupported ConditionalTheory since the System.Net.Sockets and CryptoStream tests are not exercised on browser/wasi. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/FunctionalTests/NetworkStreamTest.cs | 5 ++--- .../System.Security.Cryptography/tests/CryptoStream.cs | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs index ad727a72796646..bcf5934ae4d873 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs @@ -45,11 +45,10 @@ public void Ctor_NullSocket_ThrowsArgumentNullExceptions() AssertExtensions.Throws("socket", () => new NetworkStream(null, FileAccess.ReadWrite, false)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] + [Theory] [MemberData(nameof(ConnectedStreamConformanceTests.CopyToAsync_AllDataCopied_MemberData), MemberType = typeof(ConnectedStreamConformanceTests))] [DynamicDependency(nameof(ConnectedStreamConformanceTests.CopyToAsync_AllDataCopied_MemberData), typeof(ConnectedStreamConformanceTests))] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic | TestPlatforms.iOS | TestPlatforms.tvOS, "Mobile platforms block binding to UNIX sockets")] public override Task CopyToAsync_AllDataCopied(int byteCount, bool useAsync) => base.CopyToAsync_AllDataCopied(byteCount, useAsync); diff --git a/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs b/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs index 69c29c92c5134c..473be5888815c3 100644 --- a/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs +++ b/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs @@ -39,9 +39,7 @@ protected override Task CreateWrappedConnectedStreamsAsync(StreamPai [Theory] [MemberData(nameof(ConnectedStreamConformanceTests.ReadWrite_Success_MemberData), MemberType = typeof(ConnectedStreamConformanceTests))] [DynamicDependency(nameof(ConnectedStreamConformanceTests.ReadWrite_Success_MemberData), typeof(ConnectedStreamConformanceTests))] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/107981", TestPlatforms.Wasi)] + [SkipOnPlatform(TestPlatforms.LinuxBionic | TestPlatforms.iOS | TestPlatforms.tvOS, "Mobile platforms block binding to UNIX sockets")] public override Task ReadWrite_Success(ReadWriteMode mode, int writeSize, bool startWithFlush) => base.ReadWrite_Success(mode, writeSize, startWithFlush); [Fact] From 99dc6426bafdf11046c5a3162d194e22690647e3 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 29 May 2026 17:09:14 +0200 Subject: [PATCH 05/10] Use TestPlatforms.Android instead of LinuxBionic in mobile skip Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/FunctionalTests/NetworkStreamTest.cs | 2 +- .../System.Security.Cryptography/tests/CryptoStream.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs index bcf5934ae4d873..752293e1fb471a 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs @@ -48,7 +48,7 @@ public void Ctor_NullSocket_ThrowsArgumentNullExceptions() [Theory] [MemberData(nameof(ConnectedStreamConformanceTests.CopyToAsync_AllDataCopied_MemberData), MemberType = typeof(ConnectedStreamConformanceTests))] [DynamicDependency(nameof(ConnectedStreamConformanceTests.CopyToAsync_AllDataCopied_MemberData), typeof(ConnectedStreamConformanceTests))] - [SkipOnPlatform(TestPlatforms.LinuxBionic | TestPlatforms.iOS | TestPlatforms.tvOS, "Mobile platforms block binding to UNIX sockets")] + [SkipOnPlatform(TestPlatforms.Android | TestPlatforms.iOS | TestPlatforms.tvOS, "Mobile platforms block binding to UNIX sockets")] public override Task CopyToAsync_AllDataCopied(int byteCount, bool useAsync) => base.CopyToAsync_AllDataCopied(byteCount, useAsync); diff --git a/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs b/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs index 473be5888815c3..48f8de2f2c4fc9 100644 --- a/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs +++ b/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs @@ -39,7 +39,7 @@ protected override Task CreateWrappedConnectedStreamsAsync(StreamPai [Theory] [MemberData(nameof(ConnectedStreamConformanceTests.ReadWrite_Success_MemberData), MemberType = typeof(ConnectedStreamConformanceTests))] [DynamicDependency(nameof(ConnectedStreamConformanceTests.ReadWrite_Success_MemberData), typeof(ConnectedStreamConformanceTests))] - [SkipOnPlatform(TestPlatforms.LinuxBionic | TestPlatforms.iOS | TestPlatforms.tvOS, "Mobile platforms block binding to UNIX sockets")] + [SkipOnPlatform(TestPlatforms.Android | TestPlatforms.iOS | TestPlatforms.tvOS, "Mobile platforms block binding to UNIX sockets")] public override Task ReadWrite_Success(ReadWriteMode mode, int writeSize, bool startWithFlush) => base.ReadWrite_Success(mode, writeSize, startWithFlush); [Fact] From cb1a6be8a54e86da9051e1632286a6e690919b72 Mon Sep 17 00:00:00 2001 From: kotlarmilos Date: Tue, 9 Jun 2026 11:56:31 +0200 Subject: [PATCH 06/10] Root inherited MemberData statics against the trimmer on maccatalyst CoreCLR On maccatalyst-arm64 AllSubsets_CoreCLR (runtime-extra-platforms), ILLink strips the inherited ConnectedStreamConformanceTests.ReadWrite_Success_MemberData and CopyToAsync_AllDataCopied_MemberData statics, so xUnit's [MemberData] discovery throws ArgumentException ("Could not find public static member ...") before the test body runs, on CryptoStreamTests.ReadWrite_Success and NetworkStreamTest.CopyToAsync_AllDataCopied. Override each test to add a [DynamicDependency] root keeping the base statics alive under trimming. xUnit does not inherit attributes from overridden virtual methods, so the overrides also restate the base gating: the IsMultithreadingSupported ConditionalTheory (System.Net.Sockets.Tests runs on single-threaded wasi in CI) and the LinuxBionic and iOS/tvOS platform skips. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/FunctionalTests/NetworkStreamTest.cs | 5 +++-- .../System.Security.Cryptography/tests/CryptoStream.cs | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs index 752293e1fb471a..ad727a72796646 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs @@ -45,10 +45,11 @@ public void Ctor_NullSocket_ThrowsArgumentNullExceptions() AssertExtensions.Throws("socket", () => new NetworkStream(null, FileAccess.ReadWrite, false)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(ConnectedStreamConformanceTests.CopyToAsync_AllDataCopied_MemberData), MemberType = typeof(ConnectedStreamConformanceTests))] [DynamicDependency(nameof(ConnectedStreamConformanceTests.CopyToAsync_AllDataCopied_MemberData), typeof(ConnectedStreamConformanceTests))] - [SkipOnPlatform(TestPlatforms.Android | TestPlatforms.iOS | TestPlatforms.tvOS, "Mobile platforms block binding to UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public override Task CopyToAsync_AllDataCopied(int byteCount, bool useAsync) => base.CopyToAsync_AllDataCopied(byteCount, useAsync); diff --git a/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs b/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs index 48f8de2f2c4fc9..66ac4cc62a877d 100644 --- a/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs +++ b/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs @@ -39,7 +39,8 @@ protected override Task CreateWrappedConnectedStreamsAsync(StreamPai [Theory] [MemberData(nameof(ConnectedStreamConformanceTests.ReadWrite_Success_MemberData), MemberType = typeof(ConnectedStreamConformanceTests))] [DynamicDependency(nameof(ConnectedStreamConformanceTests.ReadWrite_Success_MemberData), typeof(ConnectedStreamConformanceTests))] - [SkipOnPlatform(TestPlatforms.Android | TestPlatforms.iOS | TestPlatforms.tvOS, "Mobile platforms block binding to UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public override Task ReadWrite_Success(ReadWriteMode mode, int writeSize, bool startWithFlush) => base.ReadWrite_Success(mode, writeSize, startWithFlush); [Fact] From 8a7d94446a584f0879b1aa02fe26b043445ebd2c Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 9 Jun 2026 12:29:50 +0200 Subject: [PATCH 07/10] Drop unneeded platform skips on CryptoStream ReadWrite_Success override CryptoStreamTests wraps in-memory ConnectedStreams.CreateBidirectional(), not sockets, so the LinuxBionic/iOS/tvOS skips (reasoned as UNIX-socket restrictions) do not apply. The sibling ReadWrite_Success_Large override in the same class carries no such skips. The override keeps [Theory], qualified [MemberData], and [DynamicDependency] to root the inherited static MemberData against the trimmer on maccatalyst CoreCLR. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../System.Security.Cryptography/tests/CryptoStream.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs b/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs index 66ac4cc62a877d..1c5f5c57ee999c 100644 --- a/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs +++ b/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs @@ -39,8 +39,6 @@ protected override Task CreateWrappedConnectedStreamsAsync(StreamPai [Theory] [MemberData(nameof(ConnectedStreamConformanceTests.ReadWrite_Success_MemberData), MemberType = typeof(ConnectedStreamConformanceTests))] [DynamicDependency(nameof(ConnectedStreamConformanceTests.ReadWrite_Success_MemberData), typeof(ConnectedStreamConformanceTests))] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public override Task ReadWrite_Success(ReadWriteMode mode, int writeSize, bool startWithFlush) => base.ReadWrite_Success(mode, writeSize, startWithFlush); [Fact] From 7444cedb568c04dc7e817646397d6cbaad366011 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 9 Jun 2026 12:41:05 +0200 Subject: [PATCH 08/10] Combine NetworkStream override skips into one line with accurate wording NetworkStreamTest binds TCP loopback sockets; the restriction is the CI sandbox blocking socket binding, not UNIX sockets specifically. Collapse the LinuxBionic and iOS/tvOS skips into a single SkipOnPlatform with a clearer reason. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/FunctionalTests/NetworkStreamTest.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs index ad727a72796646..2f735d52b2d228 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs @@ -48,8 +48,7 @@ public void Ctor_NullSocket_ThrowsArgumentNullExceptions() [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(ConnectedStreamConformanceTests.CopyToAsync_AllDataCopied_MemberData), MemberType = typeof(ConnectedStreamConformanceTests))] [DynamicDependency(nameof(ConnectedStreamConformanceTests.CopyToAsync_AllDataCopied_MemberData), typeof(ConnectedStreamConformanceTests))] - [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] + [SkipOnPlatform(TestPlatforms.LinuxBionic | TestPlatforms.iOS | TestPlatforms.tvOS, "Binding listening sockets is restricted by the CI sandbox on these platforms")] public override Task CopyToAsync_AllDataCopied(int byteCount, bool useAsync) => base.CopyToAsync_AllDataCopied(byteCount, useAsync); From fc271add4e9a0d18b2a7dd029e2c4ddc7296d381 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Sun, 14 Jun 2026 16:59:46 +0200 Subject: [PATCH 09/10] Root StreamConformanceTests assembly via ILLink descriptor instead of per-override DynamicDependency Address review feedback: rather than adding [MemberData]/[DynamicDependency] overrides on each derived test to root the inherited statics, root the StreamConformanceTests assembly in an ILLink.Descriptors.xml, mirroring System.IO.FileSystem.Tests. Reverts the CryptoStream and NetworkStreamTest overrides. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/FunctionalTests/ILLink.Descriptors.xml | 3 +++ .../tests/FunctionalTests/NetworkStreamTest.cs | 9 --------- .../FunctionalTests/System.Net.Sockets.Tests.csproj | 2 ++ .../System.Security.Cryptography/tests/CryptoStream.cs | 6 ------ .../tests/ILLink.Descriptors.xml | 3 +++ .../tests/System.Security.Cryptography.Tests.csproj | 2 ++ 6 files changed, 10 insertions(+), 15 deletions(-) create mode 100644 src/libraries/System.Net.Sockets/tests/FunctionalTests/ILLink.Descriptors.xml create mode 100644 src/libraries/System.Security.Cryptography/tests/ILLink.Descriptors.xml diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/ILLink.Descriptors.xml b/src/libraries/System.Net.Sockets/tests/FunctionalTests/ILLink.Descriptors.xml new file mode 100644 index 00000000000000..a463351bf87227 --- /dev/null +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/ILLink.Descriptors.xml @@ -0,0 +1,3 @@ + + + diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs index 2f735d52b2d228..63b862f355b39a 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs @@ -2,14 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.IO; using System.IO.Tests; using System.Linq; using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; -using Microsoft.DotNet.XUnitExtensions; using Xunit; namespace System.Net.Sockets.Tests @@ -45,13 +43,6 @@ public void Ctor_NullSocket_ThrowsArgumentNullExceptions() AssertExtensions.Throws("socket", () => new NetworkStream(null, FileAccess.ReadWrite, false)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] - [MemberData(nameof(ConnectedStreamConformanceTests.CopyToAsync_AllDataCopied_MemberData), MemberType = typeof(ConnectedStreamConformanceTests))] - [DynamicDependency(nameof(ConnectedStreamConformanceTests.CopyToAsync_AllDataCopied_MemberData), typeof(ConnectedStreamConformanceTests))] - [SkipOnPlatform(TestPlatforms.LinuxBionic | TestPlatforms.iOS | TestPlatforms.tvOS, "Binding listening sockets is restricted by the CI sandbox on these platforms")] - public override Task CopyToAsync_AllDataCopied(int byteCount, bool useAsync) => - base.CopyToAsync_AllDataCopied(byteCount, useAsync); - [Fact] public void Ctor_NotConnected_Throws() { diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/System.Net.Sockets.Tests.csproj b/src/libraries/System.Net.Sockets/tests/FunctionalTests/System.Net.Sockets.Tests.csproj index 6fdc8aa36a6974..cb162e2cbe8bce 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/System.Net.Sockets.Tests.csproj +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/System.Net.Sockets.Tests.csproj @@ -114,5 +114,7 @@ + + diff --git a/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs b/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs index 1c5f5c57ee999c..9b6a368769033b 100644 --- a/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs +++ b/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Diagnostics.CodeAnalysis; using System.IO; using System.IO.Tests; using System.Text; @@ -36,11 +35,6 @@ protected override Task CreateWrappedConnectedStreamsAsync(StreamPai [MemberData(nameof(ReadWrite_Success_Large_MemberData))] public override Task ReadWrite_Success_Large(ReadWriteMode mode, int writeSize, bool startWithFlush) => base.ReadWrite_Success_Large(mode, writeSize, startWithFlush); - [Theory] - [MemberData(nameof(ConnectedStreamConformanceTests.ReadWrite_Success_MemberData), MemberType = typeof(ConnectedStreamConformanceTests))] - [DynamicDependency(nameof(ConnectedStreamConformanceTests.ReadWrite_Success_MemberData), typeof(ConnectedStreamConformanceTests))] - public override Task ReadWrite_Success(ReadWriteMode mode, int writeSize, bool startWithFlush) => base.ReadWrite_Success(mode, writeSize, startWithFlush); - [Fact] public static void Ctor() { diff --git a/src/libraries/System.Security.Cryptography/tests/ILLink.Descriptors.xml b/src/libraries/System.Security.Cryptography/tests/ILLink.Descriptors.xml new file mode 100644 index 00000000000000..a463351bf87227 --- /dev/null +++ b/src/libraries/System.Security.Cryptography/tests/ILLink.Descriptors.xml @@ -0,0 +1,3 @@ + + + diff --git a/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj b/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj index f490702df59f7b..078f33af4e8ab5 100644 --- a/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj +++ b/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj @@ -872,6 +872,8 @@ + + From 649d5ebaea53b686dcb7bfe54904003bd5e803e0 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Sun, 14 Jun 2026 17:03:12 +0200 Subject: [PATCH 10/10] Drop redundant comment on TrimmerRootDescriptor Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/FunctionalTests/System.Net.Sockets.Tests.csproj | 1 - .../tests/System.Security.Cryptography.Tests.csproj | 1 - 2 files changed, 2 deletions(-) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/System.Net.Sockets.Tests.csproj b/src/libraries/System.Net.Sockets/tests/FunctionalTests/System.Net.Sockets.Tests.csproj index cb162e2cbe8bce..8b34188f0fc5a7 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/System.Net.Sockets.Tests.csproj +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/System.Net.Sockets.Tests.csproj @@ -114,7 +114,6 @@ - diff --git a/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj b/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj index 078f33af4e8ab5..0f83a6317608a7 100644 --- a/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj +++ b/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj @@ -872,7 +872,6 @@ -