Skip to content

Commit 943dd48

Browse files
kotlarmilosCopilot
andcommitted
Preserve base test gating attributes on overrides
xUnit does not inherit attributes from overridden virtual methods, so the ReadWrite_Success and CopyToAsync_AllDataCopied overrides must restate the base ConnectedStreamConformanceTests gating: the IsMultithreadingSupported ConditionalTheory guard, the LinuxBionic and iOS/tvOS SkipOnPlatform skips, and the WASI ActiveIssue. Keeps the DynamicDependency trimming roots that this PR adds. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c95ffd0 commit 943dd48

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ public void Ctor_NullSocket_ThrowsArgumentNullExceptions()
4545
AssertExtensions.Throws<ArgumentNullException>("socket", () => new NetworkStream(null, FileAccess.ReadWrite, false));
4646
}
4747

48-
[Theory]
48+
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))]
4949
[MemberData(nameof(ConnectedStreamConformanceTests.CopyToAsync_AllDataCopied_MemberData), MemberType = typeof(ConnectedStreamConformanceTests))]
5050
[DynamicDependency(nameof(ConnectedStreamConformanceTests.CopyToAsync_AllDataCopied_MemberData), typeof(ConnectedStreamConformanceTests))]
51-
[SkipOnPlatform(TestPlatforms.Android | TestPlatforms.iOS | TestPlatforms.tvOS, "Mobile platforms block binding to UNIX sockets")]
51+
[SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")]
52+
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")]
5253
public override Task CopyToAsync_AllDataCopied(int byteCount, bool useAsync) =>
5354
base.CopyToAsync_AllDataCopied(byteCount, useAsync);
5455

src/libraries/System.Security.Cryptography/tests/CryptoStream.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ protected override Task<StreamPair> CreateWrappedConnectedStreamsAsync(StreamPai
3939
[Theory]
4040
[MemberData(nameof(ConnectedStreamConformanceTests.ReadWrite_Success_MemberData), MemberType = typeof(ConnectedStreamConformanceTests))]
4141
[DynamicDependency(nameof(ConnectedStreamConformanceTests.ReadWrite_Success_MemberData), typeof(ConnectedStreamConformanceTests))]
42-
[SkipOnPlatform(TestPlatforms.Android | TestPlatforms.iOS | TestPlatforms.tvOS, "Mobile platforms block binding to UNIX sockets")]
42+
[SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")]
43+
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")]
44+
[ActiveIssue("https://github.com/dotnet/runtime/issues/107981", TestPlatforms.Wasi)]
4345
public override Task ReadWrite_Success(ReadWriteMode mode, int writeSize, bool startWithFlush) => base.ReadWrite_Success(mode, writeSize, startWithFlush);
4446

4547
[Fact]

0 commit comments

Comments
 (0)