diff --git a/shared/contoso.com.pfx b/shared/contoso.com.pfx index bacddeff7..a86447078 100644 Binary files a/shared/contoso.com.pfx and b/shared/contoso.com.pfx differ diff --git a/shared/dotnetty.com.pfx b/shared/dotnetty.com.pfx index 4b2c4f245..27fed55b4 100644 Binary files a/shared/dotnetty.com.pfx and b/shared/dotnetty.com.pfx differ diff --git a/src/DotNetty.Handlers/Tls/TlsHandler.MediationStream.NetCore.cs b/src/DotNetty.Handlers/Tls/TlsHandler.MediationStream.NetCore.cs index 766e2df02..4db76b0d3 100644 --- a/src/DotNetty.Handlers/Tls/TlsHandler.MediationStream.NetCore.cs +++ b/src/DotNetty.Handlers/Tls/TlsHandler.MediationStream.NetCore.cs @@ -39,6 +39,7 @@ partial class MediationStream public void SetSource(in ReadOnlyMemory source) { + Debug.Assert(SourceReadableBytes == 0); _input = source; _inputOffset = 0; _inputLength = 0; @@ -46,7 +47,9 @@ public void SetSource(in ReadOnlyMemory source) public void ResetSource() { + Debug.Assert(SourceReadableBytes == 0); _input = null; + _inputOffset = 0; _inputLength = 0; } @@ -60,6 +63,7 @@ public void ExpandSource(int count) if (sslBuffer.IsEmpty) { // there is no pending read operation - keep for future + Debug.Assert(_readCompletionSource == null); return; } _sslOwnedBuffer = default; @@ -87,6 +91,7 @@ public override ValueTask ReadAsync(Memory buffer, CancellationToken return new ValueTask(read); } + Debug.Assert(_readCompletionSource == null); Debug.Assert(_sslOwnedBuffer.IsEmpty); // take note of buffer - we will pass bytes there once available _sslOwnedBuffer = buffer; diff --git a/src/DotNetty.Handlers/Tls/TlsHandler.MediationStream.NetFx.cs b/src/DotNetty.Handlers/Tls/TlsHandler.MediationStream.NetFx.cs index cd6de86cd..8694f8d0b 100644 --- a/src/DotNetty.Handlers/Tls/TlsHandler.MediationStream.NetFx.cs +++ b/src/DotNetty.Handlers/Tls/TlsHandler.MediationStream.NetFx.cs @@ -45,6 +45,7 @@ partial class MediationStream public void SetSource(byte[] source, int offset) { + Debug.Assert(SourceReadableBytes == 0); _input = source; _inputStartOffset = offset; _inputOffset = 0; @@ -53,7 +54,9 @@ public void SetSource(byte[] source, int offset) public void ResetSource() { + Debug.Assert(SourceReadableBytes == 0); _input = null; + _inputOffset = 0; _inputLength = 0; } diff --git a/src/DotNetty.Handlers/Tls/TlsHandler.MediationStream.NetStandard20.cs b/src/DotNetty.Handlers/Tls/TlsHandler.MediationStream.NetStandard20.cs index c337ded64..d6c407734 100644 --- a/src/DotNetty.Handlers/Tls/TlsHandler.MediationStream.NetStandard20.cs +++ b/src/DotNetty.Handlers/Tls/TlsHandler.MediationStream.NetStandard20.cs @@ -39,6 +39,7 @@ partial class MediationStream public void SetSource(byte[] source, int offset) { + Debug.Assert(SourceReadableBytes == 0); _input = source; _inputStartOffset = offset; _inputOffset = 0; @@ -47,7 +48,9 @@ public void SetSource(byte[] source, int offset) public void ResetSource() { + Debug.Assert(SourceReadableBytes == 0); _input = null; + _inputOffset = 0; _inputLength = 0; } diff --git a/test/DotNetty.Codecs.Http.Tests/HttpServerKeepAliveHandlerTest.cs b/test/DotNetty.Codecs.Http.Tests/HttpServerKeepAliveHandlerTest.cs index 42c13e4cc..1007e809e 100644 --- a/test/DotNetty.Codecs.Http.Tests/HttpServerKeepAliveHandlerTest.cs +++ b/test/DotNetty.Codecs.Http.Tests/HttpServerKeepAliveHandlerTest.cs @@ -39,7 +39,7 @@ public static IEnumerable GetKeepAliveCases() => new[] }; [Theory] - [MemberData(nameof(GetKeepAliveCases))] + [MemberData(nameof(GetKeepAliveCases), DisableDiscoveryEnumeration = true)] public void KeepAlive(bool isKeepAliveResponseExpected, HttpVersion httpVersion, HttpResponseStatus responseStatus, string sendKeepAlive, int setSelfDefinedMessageLength, ICharSequence setResponseConnection) { var channel = new EmbeddedChannel(new HttpServerKeepAliveHandler()); @@ -66,7 +66,7 @@ public void KeepAlive(bool isKeepAliveResponseExpected, HttpVersion httpVersion, } [Theory] - [MemberData(nameof(GetKeepAliveCases))] + [MemberData(nameof(GetKeepAliveCases), DisableDiscoveryEnumeration = true)] #pragma warning disable xUnit1026 // Theory methods should use all of their parameters public void ConnectionCloseHeaderHandledCorrectly(bool isKeepAliveResponseExpected, HttpVersion httpVersion, HttpResponseStatus responseStatus, string sendKeepAlive, int setSelfDefinedMessageLength, ICharSequence setResponseConnection) #pragma warning restore xUnit1026 // Theory methods should use all of their parameters @@ -85,7 +85,7 @@ public void ConnectionCloseHeaderHandledCorrectly(bool isKeepAliveResponseExpect } [Theory] - [MemberData(nameof(GetKeepAliveCases))] + [MemberData(nameof(GetKeepAliveCases), DisableDiscoveryEnumeration = true)] public void PipelineKeepAlive(bool isKeepAliveResponseExpected, HttpVersion httpVersion, HttpResponseStatus responseStatus, string sendKeepAlive, int setSelfDefinedMessageLength, ICharSequence setResponseConnection) { var channel = new EmbeddedChannel(new HttpServerKeepAliveHandler()); diff --git a/test/DotNetty.Codecs.Http2.Tests/HpackTest.cs b/test/DotNetty.Codecs.Http2.Tests/HpackTest.cs index 957269d88..6d49eef8f 100644 --- a/test/DotNetty.Codecs.Http2.Tests/HpackTest.cs +++ b/test/DotNetty.Codecs.Http2.Tests/HpackTest.cs @@ -20,7 +20,7 @@ public static IEnumerable GetJsonFiles() } [Theory] - [MemberData(nameof(GetJsonFiles))] + [MemberData(nameof(GetJsonFiles), DisableDiscoveryEnumeration = true)] public void Test(FileInfo file) { using (var fs = file.Open(FileMode.Open)) diff --git a/test/DotNetty.Codecs.Protobuf.Tests/RoundTripTests.cs b/test/DotNetty.Codecs.Protobuf.Tests/RoundTripTests.cs index 75c02b8b2..f02dccc90 100644 --- a/test/DotNetty.Codecs.Protobuf.Tests/RoundTripTests.cs +++ b/test/DotNetty.Codecs.Protobuf.Tests/RoundTripTests.cs @@ -187,7 +187,7 @@ public static IEnumerable GetAddressBookCases() } [Theory] - [MemberData(nameof(GetAddressBookCases))] + [MemberData(nameof(GetAddressBookCases), DisableDiscoveryEnumeration = true)] public void Run1(AddressBook addressBook, bool isCompositeBuffer) { var channel = new EmbeddedChannel( diff --git a/test/DotNetty.Handlers.Tests/SniHandlerTest.cs b/test/DotNetty.Handlers.Tests/SniHandlerTest.cs index 9ca2e9ca2..695d3cfc7 100644 --- a/test/DotNetty.Handlers.Tests/SniHandlerTest.cs +++ b/test/DotNetty.Handlers.Tests/SniHandlerTest.cs @@ -32,11 +32,7 @@ static SniHandlerTest() X509Certificate2 tlsCertificate = TestResourceHelper.GetTestCertificate(); X509Certificate2 tlsCertificate2 = TestResourceHelper.GetTestCertificate2(); - //#if NETCOREAPP_3_0_GREATER - // SslProtocols serverProtocol = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? SslProtocols.Tls13 : SslProtocols.Tls12; - //#else - SslProtocols serverProtocol = SslProtocols.Tls12; - //#endif + SslProtocols serverProtocol = SslProtocols.None; SettingMap[tlsCertificate.GetNameInfo(X509NameType.DnsName, false)] = new ServerTlsSettings(tlsCertificate, false, false, serverProtocol); SettingMap[tlsCertificate2.GetNameInfo(X509NameType.DnsName, false)] = new ServerTlsSettings(tlsCertificate2, false, false, serverProtocol); } @@ -53,11 +49,7 @@ public static IEnumerable GetTlsReadTestData() new[] { 1 } }; var boolToggle = new[] { false, true }; - //#if NETCOREAPP_3_0_GREATER - // var protocols = new[] { RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? SslProtocols.Tls13 : SslProtocols.Tls12 }; - //#else - var protocols = new[] { SslProtocols.Tls12 }; - //#endif + var protocols = new[] { SslProtocols.None }; var writeStrategyFactories = new Func[] { () => new AsIsWriteStrategy() @@ -74,7 +66,7 @@ from targetHost in SettingMap.Keys [Theory] - [MemberData(nameof(GetTlsReadTestData))] + [MemberData(nameof(GetTlsReadTestData), DisableDiscoveryEnumeration = true)] public async Task TlsRead(int[] frameLengths, bool isClient, IWriteStrategy writeStrategy, SslProtocols protocol, string targetHost) { this.Output.WriteLine($"frameLengths: {string.Join(", ", frameLengths)}"); @@ -106,7 +98,8 @@ public async Task TlsRead(int[] frameLengths, bool isClient, IWriteStrategy writ #pragma warning disable CS1998 // 异步方法缺少 "await" 运算符,将以同步方式运行 await ReadOutboundAsync(async () => ch.ReadInbound(), expectedBuffer.ReadableBytes, finalReadBuffer, TestTimeout); #pragma warning restore CS1998 // 异步方法缺少 "await" 运算符,将以同步方式运行 - Assert.True(ByteBufferUtil.Equals(expectedBuffer, finalReadBuffer), $"---Expected:\n{ByteBufferUtil.PrettyHexDump(expectedBuffer)}\n---Actual:\n{ByteBufferUtil.PrettyHexDump(finalReadBuffer)}"); + if (!ByteBufferUtil.Equals(expectedBuffer, finalReadBuffer)) + Assert.True(false, $"---Expected:\n{ByteBufferUtil.PrettyHexDump(expectedBuffer)}\n---Actual:\n{ByteBufferUtil.PrettyHexDump(finalReadBuffer)}"); if (!isClient) { @@ -131,11 +124,7 @@ public static IEnumerable GetTlsWriteTestData() new[] { 1 } }; var boolToggle = new[] { false, true }; - //#if NETCOREAPP_3_0_GREATER - // var protocols = new[] { RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? SslProtocols.Tls13 : SslProtocols.Tls12 }; - //#else - var protocols = new[] { SslProtocols.Tls12 }; - //#endif + var protocols = new[] { SslProtocols.None }; return from frameLengths in lengthVariations @@ -186,7 +175,8 @@ await ReadOutboundAsync( return Unpooled.WrappedBuffer(readBuffer, 0, read); }, expectedBuffer.ReadableBytes, finalReadBuffer, TestTimeout); - Assert.True(ByteBufferUtil.Equals(expectedBuffer, finalReadBuffer), $"---Expected:\n{ByteBufferUtil.PrettyHexDump(expectedBuffer)}\n---Actual:\n{ByteBufferUtil.PrettyHexDump(finalReadBuffer)}"); + if (!ByteBufferUtil.Equals(expectedBuffer, finalReadBuffer)) + Assert.True(false, $"---Expected:\n{ByteBufferUtil.PrettyHexDump(expectedBuffer)}\n---Actual:\n{ByteBufferUtil.PrettyHexDump(finalReadBuffer)}"); if (!isClient) { diff --git a/test/DotNetty.Handlers.Tests/TlsHandlerTest.cs b/test/DotNetty.Handlers.Tests/TlsHandlerTest.cs index 71da5f07a..14d4ff9b3 100644 --- a/test/DotNetty.Handlers.Tests/TlsHandlerTest.cs +++ b/test/DotNetty.Handlers.Tests/TlsHandlerTest.cs @@ -7,8 +7,9 @@ namespace DotNetty.Handlers.Tests using System.Collections.Generic; using System.Diagnostics; using System.Linq; + using System.Net; using System.Net.Security; - using System.Runtime.InteropServices; + using System.Net.Sockets; using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; using System.Threading.Tasks; @@ -47,25 +48,8 @@ public static IEnumerable GetTlsReadTestData() Enumerable.Repeat(0, 30).Select(_ => random.Next(0, 17000)).ToArray() }; var boolToggle = new[] { false, true }; - var protocols = new List>(); - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - protocols.Add(Tuple.Create(SslProtocols.Tls, SslProtocols.Tls)); - protocols.Add(Tuple.Create(SslProtocols.Tls11, SslProtocols.Tls11)); - protocols.Add(Tuple.Create(SslProtocols.Tls12, SslProtocols.Tls12)); -#if NETCOREAPP_3_0_GREATER - //protocols.Add(Tuple.Create(SslProtocols.Tls13, SslProtocols.Tls13)); -#endif - protocols.Add(Tuple.Create(SslProtocols.Tls12 | SslProtocols.Tls, SslProtocols.Tls12 | SslProtocols.Tls11)); - protocols.Add(Tuple.Create(SslProtocols.Tls | SslProtocols.Tls12, SslProtocols.Tls | SslProtocols.Tls11)); - } - else - { - protocols.Add(Tuple.Create(SslProtocols.Tls11, SslProtocols.Tls11)); - protocols.Add(Tuple.Create(SslProtocols.Tls12, SslProtocols.Tls12)); - protocols.Add(Tuple.Create(SslProtocols.Tls12 | SslProtocols.Tls11, SslProtocols.Tls12 | SslProtocols.Tls11)); - protocols.Add(Tuple.Create(SslProtocols.Tls11 | SslProtocols.Tls12, SslProtocols.Tls | SslProtocols.Tls11)); - } + var protocols = new (SslProtocols serverProtocol, SslProtocols clientProtocol)[] { (SslProtocols.None, SslProtocols.None) }; + var writeStrategyFactories = new Func[] { () => new AsIsWriteStrategy(), @@ -79,12 +63,59 @@ from frameLengths in lengthVariations from isClient in boolToggle from writeStrategyFactory in writeStrategyFactories from protocol in protocols - select new object[] { frameLengths, isClient, writeStrategyFactory(), protocol.Item1, protocol.Item2 }; + select new object[] { frameLengths, isClient, writeStrategyFactory(), protocol.serverProtocol, protocol.clientProtocol }; } + public static IEnumerable GetTlsReadTestProtocol() + { + var lengthVariations = + new[] + { + new[] { 1 }, + }; + var boolToggle = new[] { false, true }; + var protocols = GetTlsTestProtocol(); + + var writeStrategyFactories = new Func[] + { + () => new AsIsWriteStrategy() + }; + + return + from frameLengths in lengthVariations + from isClient in boolToggle + from writeStrategyFactory in writeStrategyFactories + from protocol in protocols + select new object[] { frameLengths, isClient, writeStrategyFactory(), protocol.serverProtocol, protocol.clientProtocol }; + } + + static List<(SslProtocols serverProtocol, SslProtocols clientProtocol)> GetTlsTestProtocol() + { + var protocols = new List<(SslProtocols serverProtocol, SslProtocols clientProtocol)>(); + var supportedProtocolList = Platform.SupportedSslProtocolList; + foreach (var cur in supportedProtocolList) + { + protocols.Add((cur, cur)); + } + int handShakeTestCnt = 0; + var supportedProtocols = Platform.AllSupportedSslProtocols; + foreach (var cur in supportedProtocolList) + { + protocols.Add((cur, supportedProtocols)); + protocols.Add((supportedProtocols, cur)); + + handShakeTestCnt++; + if (handShakeTestCnt >= 2) + break; + } + + protocols = FilterPlatformAvailableProtocols(protocols); + return protocols; + } [Theory] - [MemberData(nameof(GetTlsReadTestData))] + [MemberData(nameof(GetTlsReadTestData), DisableDiscoveryEnumeration = true)] + [MemberData(nameof(GetTlsReadTestProtocol), DisableDiscoveryEnumeration = true)] public async Task TlsRead(int[] frameLengths, bool isClient, IWriteStrategy writeStrategy, SslProtocols serverProtocol, SslProtocols clientProtocol) { this.Output.WriteLine($"frameLengths: {string.Join(", ", frameLengths)}"); @@ -147,35 +178,35 @@ public static IEnumerable GetTlsWriteTestData() Enumerable.Repeat(0, 30).Select(_ => random.Next(0, 10) < 2 ? -1 : random.Next(0, 17000)).ToArray() }; var boolToggle = new[] { false, true }; - var protocols = new List>(); - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - protocols.Add(Tuple.Create(SslProtocols.Tls, SslProtocols.Tls)); - protocols.Add(Tuple.Create(SslProtocols.Tls11, SslProtocols.Tls11)); - protocols.Add(Tuple.Create(SslProtocols.Tls12, SslProtocols.Tls12)); -#if NETCOREAPP_3_0_GREATER - //protocols.Add(Tuple.Create(SslProtocols.Tls13, SslProtocols.Tls13)); -#endif - protocols.Add(Tuple.Create(SslProtocols.Tls12 | SslProtocols.Tls, SslProtocols.Tls12 | SslProtocols.Tls11)); - protocols.Add(Tuple.Create(SslProtocols.Tls | SslProtocols.Tls12, SslProtocols.Tls | SslProtocols.Tls11)); - } - else - { - protocols.Add(Tuple.Create(SslProtocols.Tls11, SslProtocols.Tls11)); - protocols.Add(Tuple.Create(SslProtocols.Tls12, SslProtocols.Tls12)); - protocols.Add(Tuple.Create(SslProtocols.Tls12 | SslProtocols.Tls11, SslProtocols.Tls12 | SslProtocols.Tls11)); - protocols.Add(Tuple.Create(SslProtocols.Tls11 | SslProtocols.Tls12, SslProtocols.Tls | SslProtocols.Tls11)); - } + var protocols = new (SslProtocols serverProtocol, SslProtocols clientProtocol)[] { (SslProtocols.None, SslProtocols.None) }; return from frameLengths in lengthVariations from isClient in boolToggle from protocol in protocols - select new object[] { frameLengths, isClient, protocol.Item1, protocol.Item2 }; + select new object[] { frameLengths, isClient, protocol.serverProtocol, protocol.clientProtocol }; + } + + public static IEnumerable GetTlsWriteTestProtocol() + { + var lengthVariations = + new[] + { + new[] { 1 } + }; + var boolToggle = new[] { false, true }; + var protocols = GetTlsTestProtocol(); + + return + from frameLengths in lengthVariations + from isClient in boolToggle + from protocol in protocols + select new object[] { frameLengths, isClient, protocol.serverProtocol, protocol.clientProtocol }; } [Theory] [MemberData(nameof(GetTlsWriteTestData))] + [MemberData(nameof(GetTlsWriteTestProtocol))] public async Task TlsWrite(int[] frameLengths, bool isClient, SslProtocols serverProtocol, SslProtocols clientProtocol) { this.Output.WriteLine($"frameLengths: {string.Join(", ", frameLengths)}"); @@ -232,6 +263,31 @@ await ReadOutboundAsync( } } + static List<(SslProtocols serverProtocol, SslProtocols clientProtocol)> FilterPlatformAvailableProtocols(List<(SslProtocols serverProtocol, SslProtocols clientProtocol)> protocols) + { + var set = new HashSet<(SslProtocols serverProtocol, SslProtocols clientProtocol)>(); + var list = new List<(SslProtocols serverProtocol, SslProtocols clientProtocol)>(protocols.Count + 1); + + //Ensure there is at least one test available(SslProtocols.None: Allows the operating system to choose the best protocol to use, and to block protocols that are not secure.) + list.Add((SslProtocols.None, SslProtocols.None)); + + var supportedSslProtocols = Platform.AllSupportedSslProtocols; + if (supportedSslProtocols != SslProtocols.None) + { + foreach (var cur in protocols) + { + var (serverProtocol, clientProtocol) = cur; + serverProtocol &= supportedSslProtocols; + clientProtocol &= supportedSslProtocols; + if ((serverProtocol & clientProtocol) == SslProtocols.None) + continue; + if (set.Add((serverProtocol, clientProtocol))) + list.Add((serverProtocol, clientProtocol)); + } + } + return list; + } + static async Task> SetupStreamAndChannelAsync(bool isClient, IEventExecutor executor, IWriteStrategy writeStrategy, SslProtocols serverProtocol, SslProtocols clientProtocol, List writeTasks) { X509Certificate2 tlsCertificate = TestResourceHelper.GetTestCertificate(); @@ -283,6 +339,9 @@ static async Task> SetupStreamAndChannelAsync( { await Task.Run(() => driverStream.AuthenticateAsClientAsync(targetHost, null, clientProtocol, false)).WithTimeout(TimeSpan.FromSeconds(5)); } + if ((clientProtocol & serverProtocol) != SslProtocols.None) + Assert.True((clientProtocol & serverProtocol & driverStream.SslProtocol) != SslProtocols.None, "Unexpected ssl handshake protocol: " + driverStream.SslProtocol); + writeTasks.Clear(); return Tuple.Create(ch, driverStream); @@ -378,5 +437,82 @@ public override void ChannelActive(IChannelHandlerContext context) } } } + + public static class Platform + { + public static readonly SslProtocols AllSupportedSslProtocols; + public static readonly IReadOnlyList SupportedSslProtocolList; + static Platform() + { + var allProtocol = new[] + { + SslProtocols.Tls, + SslProtocols.Tls11, + SslProtocols.Tls12, +#if NETCOREAPP_3_0_GREATER + SslProtocols.Tls13, +#endif + }; + var protocols = SslProtocols.None; + var list = new List(); + foreach (var cur in allProtocol) + { + if (CheckSslProtocol(cur)) + { + protocols |= cur; + list.Add(cur); + } + } + AllSupportedSslProtocols = protocols; + SupportedSslProtocolList = list.AsReadOnly(); + } + + private static bool CheckSslProtocol(SslProtocols protocol) + { + X509Certificate2 tlsCertificate = TestResourceHelper.GetTestCertificate(); + string targetHost = tlsCertificate.GetNameInfo(X509NameType.SimpleName, false); + try + { + using (var server = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) + { + server.Bind(new IPEndPoint(IPAddress.Loopback, 0)); + server.Listen(1); + using (var client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) + { + Task.Run(async () => + { + client.Connect(server.LocalEndPoint); + using (var a = new SslStream(new NetworkStream(server.Accept(), ownsSocket: true))) + using (var b = new SslStream(new NetworkStream(client, ownsSocket: true), false, (sender, certificate, chain, sslPolicyErrors) => true)) + { + await Task.WhenAll( + Task.Run(async () => + { + using (b) + { + await b.AuthenticateAsClientAsync(targetHost, null, protocol, false); + Debug.Assert(b.SslProtocol == protocol); + } + }), + Task.Run(async () => + { + using (a) + { + await a.AuthenticateAsServerAsync(tlsCertificate, false, protocol, false); + Debug.Assert(a.SslProtocol == protocol); + } + })); + } + }).WithTimeout(TimeSpan.FromSeconds(1)).GetAwaiter().GetResult(); + } + } + return true; + } + catch + { + return false; + } + } + } } } diff --git a/test/DotNetty.Suite.Tests/Transport/Socket/AbstractSocketShutdownOutputByPeerTest.cs b/test/DotNetty.Suite.Tests/Transport/Socket/AbstractSocketShutdownOutputByPeerTest.cs index b77e117ac..b1ea5d775 100644 --- a/test/DotNetty.Suite.Tests/Transport/Socket/AbstractSocketShutdownOutputByPeerTest.cs +++ b/test/DotNetty.Suite.Tests/Transport/Socket/AbstractSocketShutdownOutputByPeerTest.cs @@ -21,7 +21,7 @@ public AbstractSocketShutdownOutputByPeerTest(ITestOutputHelper output) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public void TestShutdownOutput(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -72,7 +72,7 @@ public void TestShutdownOutput(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public void TestShutdownOutputWithoutOption(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); diff --git a/test/DotNetty.Suite.Tests/Transport/Socket/CompositeBufferGatheringWriteTest.cs b/test/DotNetty.Suite.Tests/Transport/Socket/CompositeBufferGatheringWriteTest.cs index 4ab49055a..5b21522c1 100644 --- a/test/DotNetty.Suite.Tests/Transport/Socket/CompositeBufferGatheringWriteTest.cs +++ b/test/DotNetty.Suite.Tests/Transport/Socket/CompositeBufferGatheringWriteTest.cs @@ -21,7 +21,7 @@ public CompositeBufferGatheringWriteTest(ITestOutputHelper output) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSingleCompositeBufferWrite(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -32,7 +32,7 @@ public Task TestSingleCompositeBufferWrite(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSingleCompositeBufferWrite_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -43,7 +43,7 @@ public Task TestSingleCompositeBufferWrite_LibuvClient(IByteBufferAllocator allo } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSingleCompositeBufferWrite_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -54,7 +54,7 @@ public Task TestSingleCompositeBufferWrite_LibuvServer_SocketClient(IByteBufferA } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSingleCompositeBufferWrite_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -187,7 +187,7 @@ protected static void CompositeBufferPartialWriteDoesNotCorruptDataInitServerCon } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestCompositeBufferPartialWriteDoesNotCorruptData(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -198,7 +198,7 @@ public Task TestCompositeBufferPartialWriteDoesNotCorruptData(IByteBufferAllocat } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestCompositeBufferPartialWriteDoesNotCorruptData_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -209,7 +209,7 @@ public Task TestCompositeBufferPartialWriteDoesNotCorruptData_LibuvClient(IByteB } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestCompositeBufferPartialWriteDoesNotCorruptData_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -220,7 +220,7 @@ public Task TestCompositeBufferPartialWriteDoesNotCorruptData_LibuvServer_Socket } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestCompositeBufferPartialWriteDoesNotCorruptData_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); diff --git a/test/DotNetty.Suite.Tests/Transport/Socket/SocketAutoReadTest.cs b/test/DotNetty.Suite.Tests/Transport/Socket/SocketAutoReadTest.cs index 08baf2c90..648048c02 100644 --- a/test/DotNetty.Suite.Tests/Transport/Socket/SocketAutoReadTest.cs +++ b/test/DotNetty.Suite.Tests/Transport/Socket/SocketAutoReadTest.cs @@ -18,7 +18,7 @@ public SocketAutoReadTest(ITestOutputHelper output) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestAutoReadOffDuringReadOnlyReadsOneTime(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -29,7 +29,7 @@ public Task TestAutoReadOffDuringReadOnlyReadsOneTime(IByteBufferAllocator alloc } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestAutoReadOffDuringReadOnlyReadsOneTime_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -40,7 +40,7 @@ public Task TestAutoReadOffDuringReadOnlyReadsOneTime_LibuvClient(IByteBufferAll } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestAutoReadOffDuringReadOnlyReadsOneTime_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -51,7 +51,7 @@ public Task TestAutoReadOffDuringReadOnlyReadsOneTime_LibuvServer_SocketClient(I } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestAutoReadOffDuringReadOnlyReadsOneTime_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); diff --git a/test/DotNetty.Suite.Tests/Transport/Socket/SocketBufReleaseTest.cs b/test/DotNetty.Suite.Tests/Transport/Socket/SocketBufReleaseTest.cs index daac8ad94..449d47709 100644 --- a/test/DotNetty.Suite.Tests/Transport/Socket/SocketBufReleaseTest.cs +++ b/test/DotNetty.Suite.Tests/Transport/Socket/SocketBufReleaseTest.cs @@ -17,7 +17,7 @@ public SocketBufReleaseTest(ITestOutputHelper output) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestBufRelease(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -28,7 +28,7 @@ public Task TestBufRelease(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestBufRelease_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -39,7 +39,7 @@ public Task TestBufRelease_LibuvClient(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestBufRelease_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -50,7 +50,7 @@ public Task TestBufRelease_LibuvServer_SocketClient(IByteBufferAllocator allocat } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestBufRelease_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); diff --git a/test/DotNetty.Suite.Tests/Transport/Socket/SocketCancelWriteTest.cs b/test/DotNetty.Suite.Tests/Transport/Socket/SocketCancelWriteTest.cs index 5500b0e40..87c28dfac 100644 --- a/test/DotNetty.Suite.Tests/Transport/Socket/SocketCancelWriteTest.cs +++ b/test/DotNetty.Suite.Tests/Transport/Socket/SocketCancelWriteTest.cs @@ -21,7 +21,7 @@ public SocketCancelWriteTest(ITestOutputHelper output) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestCancelWrite(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -32,7 +32,7 @@ public Task TestCancelWrite(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestCancelWrite_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -43,7 +43,7 @@ public Task TestCancelWrite_LibuvClient(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestCancelWrite_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -54,7 +54,7 @@ public Task TestCancelWrite_LibuvServer_SocketClient(IByteBufferAllocator alloca } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestCancelWrite_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); diff --git a/test/DotNetty.Suite.Tests/Transport/Socket/SocketConditionalWritabilityTest.cs b/test/DotNetty.Suite.Tests/Transport/Socket/SocketConditionalWritabilityTest.cs index 30d7dea5a..68f4fb657 100644 --- a/test/DotNetty.Suite.Tests/Transport/Socket/SocketConditionalWritabilityTest.cs +++ b/test/DotNetty.Suite.Tests/Transport/Socket/SocketConditionalWritabilityTest.cs @@ -23,7 +23,7 @@ public SocketConditionalWritabilityTest(ITestOutputHelper output) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestConditionalWritability(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -34,7 +34,7 @@ public Task TestConditionalWritability(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestConditionalWritability_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -45,7 +45,7 @@ public Task TestConditionalWritability_LibuvClient(IByteBufferAllocator allocato } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestConditionalWritability_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -56,7 +56,7 @@ public Task TestConditionalWritability_LibuvServer_SocketClient(IByteBufferAlloc } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestConditionalWritability_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); diff --git a/test/DotNetty.Suite.Tests/Transport/Socket/SocketConnectTest.cs b/test/DotNetty.Suite.Tests/Transport/Socket/SocketConnectTest.cs index 25639639b..aa49470ed 100644 --- a/test/DotNetty.Suite.Tests/Transport/Socket/SocketConnectTest.cs +++ b/test/DotNetty.Suite.Tests/Transport/Socket/SocketConnectTest.cs @@ -29,7 +29,7 @@ public SocketConnectTest(ITestOutputHelper output) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestLocalAddressAfterConnect(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -40,7 +40,7 @@ public Task TestLocalAddressAfterConnect(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestLocalAddressAfterConnect_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -51,7 +51,7 @@ public Task TestLocalAddressAfterConnect_LibuvClient(IByteBufferAllocator alloca } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestLocalAddressAfterConnect_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -62,7 +62,7 @@ public Task TestLocalAddressAfterConnect_LibuvServer_SocketClient(IByteBufferAll } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestLocalAddressAfterConnect_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -122,7 +122,7 @@ public override void ChannelActive(IChannelHandlerContext ctx) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestChannelEventsFiredWhenClosedDirectly(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -133,7 +133,7 @@ public Task TestChannelEventsFiredWhenClosedDirectly(IByteBufferAllocator alloca } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestChannelEventsFiredWhenClosedDirectly_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -144,7 +144,7 @@ public Task TestChannelEventsFiredWhenClosedDirectly_LibuvClient(IByteBufferAllo } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestChannelEventsFiredWhenClosedDirectly_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -155,7 +155,7 @@ public Task TestChannelEventsFiredWhenClosedDirectly_LibuvServer_SocketClient(IB } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestChannelEventsFiredWhenClosedDirectly_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); diff --git a/test/DotNetty.Suite.Tests/Transport/Socket/SocketDataReadInitialStateTest.cs b/test/DotNetty.Suite.Tests/Transport/Socket/SocketDataReadInitialStateTest.cs index 50aeeebc1..d3a15d4e4 100644 --- a/test/DotNetty.Suite.Tests/Transport/Socket/SocketDataReadInitialStateTest.cs +++ b/test/DotNetty.Suite.Tests/Transport/Socket/SocketDataReadInitialStateTest.cs @@ -18,7 +18,7 @@ public SocketDataReadInitialStateTest(ITestOutputHelper output) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestAutoReadOffNoDataReadUntilReadCalled(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -29,7 +29,7 @@ public Task TestAutoReadOffNoDataReadUntilReadCalled(IByteBufferAllocator alloca } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestAutoReadOffNoDataReadUntilReadCalled_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -40,7 +40,7 @@ public Task TestAutoReadOffNoDataReadUntilReadCalled_LibuvClient(IByteBufferAllo } [Theory(Skip = "TODO 暂时忽略,单独运行可通过测试")] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestAutoReadOffNoDataReadUntilReadCalled_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -51,7 +51,7 @@ public Task TestAutoReadOffNoDataReadUntilReadCalled_LibuvServer_SocketClient(IB } [Theory(Skip = "TODO 暂时忽略,单独运行可通过测试")] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestAutoReadOffNoDataReadUntilReadCalled_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -151,7 +151,7 @@ public override void ChannelRead(IChannelHandlerContext ctx, object msg) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestAutoReadOnDataReadImmediately(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -162,7 +162,7 @@ public Task TestAutoReadOnDataReadImmediately(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestAutoReadOnDataReadImmediately_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -173,7 +173,7 @@ public Task TestAutoReadOnDataReadImmediately_LibuvClient(IByteBufferAllocator a } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestAutoReadOnDataReadImmediately_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -184,7 +184,7 @@ public Task TestAutoReadOnDataReadImmediately_LibuvServer_SocketClient(IByteBuff } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestAutoReadOnDataReadImmediately_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); diff --git a/test/DotNetty.Suite.Tests/Transport/Socket/SocketEchoTest.cs b/test/DotNetty.Suite.Tests/Transport/Socket/SocketEchoTest.cs index 52d81df8b..2004beb3e 100644 --- a/test/DotNetty.Suite.Tests/Transport/Socket/SocketEchoTest.cs +++ b/test/DotNetty.Suite.Tests/Transport/Socket/SocketEchoTest.cs @@ -32,7 +32,7 @@ public void Dispose() } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEcho(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -43,7 +43,7 @@ public Task TestSimpleEcho(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEcho_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -54,7 +54,7 @@ public Task TestSimpleEcho_LibuvClient(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEcho_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -65,7 +65,7 @@ public Task TestSimpleEcho_LibuvServer_SocketClient(IByteBufferAllocator allocat } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEcho_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -91,7 +91,7 @@ private async Task TestSimpleEcho0(ServerBootstrap sb, Bootstrap cb) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoNotAutoRead(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -102,7 +102,7 @@ public Task TestSimpleEchoNotAutoRead(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoNotAutoRead_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -113,7 +113,7 @@ public Task TestSimpleEchoNotAutoRead_LibuvClient(IByteBufferAllocator allocator } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoNotAutoRead_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -124,7 +124,7 @@ public Task TestSimpleEchoNotAutoRead_LibuvServer_SocketClient(IByteBufferAlloca } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoNotAutoRead_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -150,7 +150,7 @@ private async Task TestSimpleEchoNotAutoRead0(ServerBootstrap sb, Bootstrap cb) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoWithAdditionalExecutor(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -161,7 +161,7 @@ public Task TestSimpleEchoWithAdditionalExecutor(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoWithAdditionalExecutor_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -172,7 +172,7 @@ public Task TestSimpleEchoWithAdditionalExecutor_LibuvClient(IByteBufferAllocato } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoWithAdditionalExecutor_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -183,7 +183,7 @@ public Task TestSimpleEchoWithAdditionalExecutor_LibuvServer_SocketClient(IByteB } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoWithAdditionalExecutor_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -209,7 +209,7 @@ private async Task TestSimpleEchoWithAdditionalExecutor0(ServerBootstrap sb, Boo } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoWithAdditionalExecutorNotAutoRead(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -220,7 +220,7 @@ public Task TestSimpleEchoWithAdditionalExecutorNotAutoRead(IByteBufferAllocator } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoWithAdditionalExecutorNotAutoRead_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -231,7 +231,7 @@ public Task TestSimpleEchoWithAdditionalExecutorNotAutoRead_LibuvClient(IByteBuf } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoWithAdditionalExecutorNotAutoRead_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -242,7 +242,7 @@ public Task TestSimpleEchoWithAdditionalExecutorNotAutoRead_LibuvServer_SocketCl } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoWithAdditionalExecutorNotAutoRead_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -268,7 +268,7 @@ private async Task TestSimpleEchoWithAdditionalExecutorNotAutoRead0(ServerBootst } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoWithVoidPromise(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -279,7 +279,7 @@ public Task TestSimpleEchoWithVoidPromise(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoWithVoidPromise_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -290,7 +290,7 @@ public Task TestSimpleEchoWithVoidPromise_LibuvClient(IByteBufferAllocator alloc } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoWithVoidPromise_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -301,7 +301,7 @@ public Task TestSimpleEchoWithVoidPromise_LibuvServer_SocketClient(IByteBufferAl } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoWithVoidPromise_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -327,7 +327,7 @@ private async Task TestSimpleEchoWithVoidPromise0(ServerBootstrap sb, Bootstrap } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoWithVoidPromiseNotAutoRead(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -338,7 +338,7 @@ public Task TestSimpleEchoWithVoidPromiseNotAutoRead(IByteBufferAllocator alloca } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoWithVoidPromiseNotAutoRead_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -349,7 +349,7 @@ public Task TestSimpleEchoWithVoidPromiseNotAutoRead_LibuvClient(IByteBufferAllo } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoWithVoidPromiseNotAutoRead_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -360,7 +360,7 @@ public Task TestSimpleEchoWithVoidPromiseNotAutoRead_LibuvServer_SocketClient(IB } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoWithVoidPromiseNotAutoRead_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -386,7 +386,7 @@ private async Task TestSimpleEchoWithVoidPromiseNotAutoRead0(ServerBootstrap sb, } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoWithAdditionalExecutorAndVoidPromise(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -397,7 +397,7 @@ public Task TestSimpleEchoWithAdditionalExecutorAndVoidPromise(IByteBufferAlloca } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoWithAdditionalExecutorAndVoidPromise_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -408,7 +408,7 @@ public Task TestSimpleEchoWithAdditionalExecutorAndVoidPromise_LibuvClient(IByte } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoWithAdditionalExecutorAndVoidPromise_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -419,7 +419,7 @@ public Task TestSimpleEchoWithAdditionalExecutorAndVoidPromise_LibuvServer_Socke } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestSimpleEchoWithAdditionalExecutorAndVoidPromise_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); diff --git a/test/DotNetty.Suite.Tests/Transport/Socket/SocketExceptionHandlingTest.cs b/test/DotNetty.Suite.Tests/Transport/Socket/SocketExceptionHandlingTest.cs index 999240e88..683edc46f 100644 --- a/test/DotNetty.Suite.Tests/Transport/Socket/SocketExceptionHandlingTest.cs +++ b/test/DotNetty.Suite.Tests/Transport/Socket/SocketExceptionHandlingTest.cs @@ -28,7 +28,7 @@ public SocketExceptionHandlingTest(ITestOutputHelper output) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestReadPendingIsResetAfterEachRead(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -39,7 +39,7 @@ public Task TestReadPendingIsResetAfterEachRead(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestReadPendingIsResetAfterEachRead_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -50,7 +50,7 @@ public Task TestReadPendingIsResetAfterEachRead_LibuvClient(IByteBufferAllocator } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestReadPendingIsResetAfterEachRead_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -61,7 +61,7 @@ public Task TestReadPendingIsResetAfterEachRead_LibuvServer_SocketClient(IByteBu } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestReadPendingIsResetAfterEachRead_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); diff --git a/test/DotNetty.Suite.Tests/Transport/Socket/SocketFixedLengthEchoTest.cs b/test/DotNetty.Suite.Tests/Transport/Socket/SocketFixedLengthEchoTest.cs index a3e59ae78..0e5df35f2 100644 --- a/test/DotNetty.Suite.Tests/Transport/Socket/SocketFixedLengthEchoTest.cs +++ b/test/DotNetty.Suite.Tests/Transport/Socket/SocketFixedLengthEchoTest.cs @@ -31,7 +31,7 @@ public SocketFixedLengthEchoTest(ITestOutputHelper output) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestFixedLengthEcho(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -42,7 +42,7 @@ public Task TestFixedLengthEcho(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestFixedLengthEcho_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -53,7 +53,7 @@ public Task TestFixedLengthEcho_LibuvClient(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestFixedLengthEcho_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -64,7 +64,7 @@ public Task TestFixedLengthEcho_LibuvServer_SocketClient(IByteBufferAllocator al } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestFixedLengthEcho_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -90,7 +90,7 @@ private async Task TestFixedLengthEcho0(ServerBootstrap sb, Bootstrap cb) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestFixedLengthEchoNotAutoRead(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -101,7 +101,7 @@ public Task TestFixedLengthEchoNotAutoRead(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestFixedLengthEchoNotAutoRead_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -112,7 +112,7 @@ public Task TestFixedLengthEchoNotAutoRead_LibuvClient(IByteBufferAllocator allo } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestFixedLengthEchoNotAutoRead_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -123,7 +123,7 @@ public Task TestFixedLengthEchoNotAutoRead_LibuvServer_SocketClient(IByteBufferA } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestFixedLengthEchoNotAutoRead_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); diff --git a/test/DotNetty.Suite.Tests/Transport/Socket/SocketGatheringWriteTest.cs b/test/DotNetty.Suite.Tests/Transport/Socket/SocketGatheringWriteTest.cs index 44c129103..683e0d968 100644 --- a/test/DotNetty.Suite.Tests/Transport/Socket/SocketGatheringWriteTest.cs +++ b/test/DotNetty.Suite.Tests/Transport/Socket/SocketGatheringWriteTest.cs @@ -34,7 +34,7 @@ public void Dispose() } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestGatheringWrite(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -45,7 +45,7 @@ public Task TestGatheringWrite(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestGatheringWrite_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -56,7 +56,7 @@ public Task TestGatheringWrite_LibuvClient(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestGatheringWrite_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -67,7 +67,7 @@ public Task TestGatheringWrite_LibuvServer_SocketClient(IByteBufferAllocator all } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestGatheringWrite_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -93,7 +93,7 @@ private async Task TestGatheringWrite0(ServerBootstrap sb, Bootstrap cb) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestGatheringWriteNotAutoRead(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -104,7 +104,7 @@ public Task TestGatheringWriteNotAutoRead(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestGatheringWriteNotAutoRead_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -115,7 +115,7 @@ public Task TestGatheringWriteNotAutoRead_LibuvClient(IByteBufferAllocator alloc } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestGatheringWriteNotAutoRead_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -126,7 +126,7 @@ public Task TestGatheringWriteNotAutoRead_LibuvServer_SocketClient(IByteBufferAl } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestGatheringWriteNotAutoRead_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -152,7 +152,7 @@ private async Task TestGatheringWriteNotAutoRead0(ServerBootstrap sb, Bootstrap } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestGatheringWriteWithComposite(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -163,7 +163,7 @@ public Task TestGatheringWriteWithComposite(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestGatheringWriteWithComposite_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -174,7 +174,7 @@ public Task TestGatheringWriteWithComposite_LibuvClient(IByteBufferAllocator all } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestGatheringWriteWithComposite_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -185,7 +185,7 @@ public Task TestGatheringWriteWithComposite_LibuvServer_SocketClient(IByteBuffer } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestGatheringWriteWithComposite_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -211,7 +211,7 @@ private async Task TestGatheringWriteWithComposite0(ServerBootstrap sb, Bootstra } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestGatheringWriteWithCompositeNotAutoRead(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -222,7 +222,7 @@ public Task TestGatheringWriteWithCompositeNotAutoRead(IByteBufferAllocator allo } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestGatheringWriteWithCompositeNotAutoRead_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -233,7 +233,7 @@ public Task TestGatheringWriteWithCompositeNotAutoRead_LibuvClient(IByteBufferAl } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestGatheringWriteWithCompositeNotAutoRead_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -244,7 +244,7 @@ public Task TestGatheringWriteWithCompositeNotAutoRead_LibuvServer_SocketClient( } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestGatheringWriteWithCompositeNotAutoRead_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -271,7 +271,7 @@ private async Task TestGatheringWriteWithCompositeNotAutoRead0(ServerBootstrap s // Test for https://github.com/netty/netty/issues/2647 [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestGatheringWriteBig(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -282,7 +282,7 @@ public Task TestGatheringWriteBig(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestGatheringWriteBig_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -293,7 +293,7 @@ public Task TestGatheringWriteBig_LibuvClient(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestGatheringWriteBig_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -304,7 +304,7 @@ public Task TestGatheringWriteBig_LibuvServer_SocketClient(IByteBufferAllocator } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestGatheringWriteBig_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); diff --git a/test/DotNetty.Suite.Tests/Transport/Socket/SocketHalfClosedTest.cs b/test/DotNetty.Suite.Tests/Transport/Socket/SocketHalfClosedTest.cs index 38281c1ed..cf5dc1079 100644 --- a/test/DotNetty.Suite.Tests/Transport/Socket/SocketHalfClosedTest.cs +++ b/test/DotNetty.Suite.Tests/Transport/Socket/SocketHalfClosedTest.cs @@ -20,7 +20,7 @@ public SocketHalfClosedTest(ITestOutputHelper output) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public void TestHalfClosureOnlyOneEventWhenAutoRead(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -113,7 +113,7 @@ public override void ExceptionCaught(IChannelHandlerContext ctx, Exception cause } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public void TestAllDataReadAfterHalfClosure(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -276,7 +276,7 @@ public override void ExceptionCaught(IChannelHandlerContext ctx, Exception cause } //[Theory] - //[MemberData(nameof(GetAllocators))] + //[MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] [Fact(Skip = "TestAutoCloseFalseDoesShutdownOutput")] public void TestAutoCloseFalseDoesShutdownOutput(/*IByteBufferAllocator allocator*/) { @@ -509,7 +509,7 @@ private void CheckPrematureClose() } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public void TestAllDataReadClosure(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -520,7 +520,7 @@ public void TestAllDataReadClosure(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public void TestAllDataReadClosure_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -531,7 +531,7 @@ public void TestAllDataReadClosure_LibuvClient(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public void TestAllDataReadClosure_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -542,7 +542,7 @@ public void TestAllDataReadClosure_LibuvServer_SocketClient(IByteBufferAllocator } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public void TestAllDataReadClosure_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); diff --git a/test/DotNetty.Suite.Tests/Transport/Socket/SocketReadPendingTest.cs b/test/DotNetty.Suite.Tests/Transport/Socket/SocketReadPendingTest.cs index fe9d6d02b..3bbda012a 100644 --- a/test/DotNetty.Suite.Tests/Transport/Socket/SocketReadPendingTest.cs +++ b/test/DotNetty.Suite.Tests/Transport/Socket/SocketReadPendingTest.cs @@ -18,7 +18,7 @@ public SocketReadPendingTest(ITestOutputHelper output) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestReadPendingIsResetAfterEachRead(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -29,7 +29,7 @@ public Task TestReadPendingIsResetAfterEachRead(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestReadPendingIsResetAfterEachRead_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -40,7 +40,7 @@ public Task TestReadPendingIsResetAfterEachRead_LibuvClient(IByteBufferAllocator } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestReadPendingIsResetAfterEachRead_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -51,7 +51,7 @@ public Task TestReadPendingIsResetAfterEachRead_LibuvServer_SocketClient(IByteBu } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestReadPendingIsResetAfterEachRead_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); diff --git a/test/DotNetty.Suite.Tests/Transport/Socket/SocketRstTest.cs b/test/DotNetty.Suite.Tests/Transport/Socket/SocketRstTest.cs index 366856a13..8a5c1f646 100644 --- a/test/DotNetty.Suite.Tests/Transport/Socket/SocketRstTest.cs +++ b/test/DotNetty.Suite.Tests/Transport/Socket/SocketRstTest.cs @@ -29,7 +29,7 @@ public SocketRstTest(ITestOutputHelper output) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public async Task TestSoLingerZeroCausesOnlyRstOnClose(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -50,7 +50,7 @@ public async Task TestSoLingerZeroCausesOnlyRstOnClose(IByteBufferAllocator allo } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public async Task TestSoLingerZeroCausesOnlyRstOnClose_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -71,7 +71,7 @@ public async Task TestSoLingerZeroCausesOnlyRstOnClose_LibuvClient(IByteBufferAl } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public async Task TestSoLingerZeroCausesOnlyRstOnClose_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -92,7 +92,7 @@ public async Task TestSoLingerZeroCausesOnlyRstOnClose_LibuvServer_SocketClient( } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public async Task TestSoLingerZeroCausesOnlyRstOnClose_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -153,7 +153,7 @@ private async Task TestSoLingerZeroCausesOnlyRstOnClose0(ServerBootstrap sb, Boo } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public async Task TestNoRstIfSoLingerOnClose(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -174,7 +174,7 @@ public async Task TestNoRstIfSoLingerOnClose(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public async Task TestNoRstIfSoLingerOnClose_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -195,7 +195,7 @@ public async Task TestNoRstIfSoLingerOnClose_LibuvClient(IByteBufferAllocator al } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public async Task TestNoRstIfSoLingerOnClose_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -216,7 +216,7 @@ public async Task TestNoRstIfSoLingerOnClose_LibuvServer_SocketClient(IByteBuffe } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public async Task TestNoRstIfSoLingerOnClose_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); diff --git a/test/DotNetty.Suite.Tests/Transport/Socket/SocketStringEchoTest.cs b/test/DotNetty.Suite.Tests/Transport/Socket/SocketStringEchoTest.cs index 5da9d407a..4dc64409d 100644 --- a/test/DotNetty.Suite.Tests/Transport/Socket/SocketStringEchoTest.cs +++ b/test/DotNetty.Suite.Tests/Transport/Socket/SocketStringEchoTest.cs @@ -43,7 +43,7 @@ public SocketStringEchoTest(ITestOutputHelper output) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestStringEcho(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -54,7 +54,7 @@ public Task TestStringEcho(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestStringEcho_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -65,7 +65,7 @@ public Task TestStringEcho_LibuvClient(IByteBufferAllocator allocator) } [Theory()] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestStringEcho_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -76,7 +76,7 @@ public Task TestStringEcho_LibuvServer_SocketClient(IByteBufferAllocator allocat } [Theory()] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestStringEcho_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -103,7 +103,7 @@ private async Task TestStringEcho0(ServerBootstrap sb, Bootstrap cb) [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestStringEchoNotAutoRead(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -114,7 +114,7 @@ public Task TestStringEchoNotAutoRead(IByteBufferAllocator allocator) } [Theory()] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestStringEchoNotAutoRead_LibuvClient(IByteBufferAllocator allocator) { var sb = DefaultServerBootstrapFactory.Instance.NewInstance(); @@ -125,7 +125,7 @@ public Task TestStringEchoNotAutoRead_LibuvClient(IByteBufferAllocator allocator } [Theory()] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestStringEchoNotAutoRead_LibuvServer_SocketClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); @@ -136,7 +136,7 @@ public Task TestStringEchoNotAutoRead_LibuvServer_SocketClient(IByteBufferAlloca } [Theory()] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public Task TestStringEchoNotAutoRead_LibuvServer_LibuvClient(IByteBufferAllocator allocator) { var sb = LibuvServerBootstrapFactory.Instance.NewInstance(); diff --git a/test/DotNetty.Suite.Tests/Transport/Socket/WriteBeforeRegisteredTest.cs b/test/DotNetty.Suite.Tests/Transport/Socket/WriteBeforeRegisteredTest.cs index fced79abb..57c894695 100644 --- a/test/DotNetty.Suite.Tests/Transport/Socket/WriteBeforeRegisteredTest.cs +++ b/test/DotNetty.Suite.Tests/Transport/Socket/WriteBeforeRegisteredTest.cs @@ -16,7 +16,7 @@ public WriteBeforeRegisteredTest(ITestOutputHelper output) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public void WriteBeforeConnect(IByteBufferAllocator allocator) { var cb = DefaultClientBootstrapFactory.Instance.NewInstance(); @@ -26,7 +26,7 @@ public void WriteBeforeConnect(IByteBufferAllocator allocator) } [Theory] - [MemberData(nameof(GetAllocators))] + [MemberData(nameof(GetAllocators), DisableDiscoveryEnumeration = true)] public void LibuvWriteBeforeConnect(IByteBufferAllocator allocator) { var cb = LibuvClientBootstrapFactory.Instance.NewInstance(); diff --git a/test/DotNetty.Tests.Common/TestResourceHelper.cs b/test/DotNetty.Tests.Common/TestResourceHelper.cs index fae5670ec..a1418a07e 100644 --- a/test/DotNetty.Tests.Common/TestResourceHelper.cs +++ b/test/DotNetty.Tests.Common/TestResourceHelper.cs @@ -9,30 +9,42 @@ namespace DotNetty.Tests.Common public static class TestResourceHelper { + static X509Certificate2 _testCert; + static X509Certificate2 _testCert2; + public static X509Certificate2 GetTestCertificate() { - byte[] certData; - using (Stream resStream = typeof(TestResourceHelper).GetTypeInfo().Assembly.GetManifestResourceStream(typeof(TestResourceHelper).Namespace + "." + "dotnetty.com.pfx")) - using (var memStream = new MemoryStream()) + var testCert = _testCert; + if (testCert is null) { - resStream.CopyTo(memStream); - certData = memStream.ToArray(); + byte[] certData; + using (Stream resStream = typeof(TestResourceHelper).GetTypeInfo().Assembly.GetManifestResourceStream(typeof(TestResourceHelper).Namespace + "." + "dotnetty.com.pfx")) + using (var memStream = new MemoryStream()) + { + resStream.CopyTo(memStream); + certData = memStream.ToArray(); + } + testCert = _testCert = new X509Certificate2(certData, "password"); } - return new X509Certificate2(certData, "password"); + return testCert; } public static X509Certificate2 GetTestCertificate2() { - byte[] certData; - using (Stream resStream = typeof(TestResourceHelper).GetTypeInfo().Assembly.GetManifestResourceStream(typeof(TestResourceHelper).Namespace + "." + "contoso.com.pfx")) - using (var memStream = new MemoryStream()) + var testCert2 = _testCert2; + if (testCert2 is null) { - resStream.CopyTo(memStream); - certData = memStream.ToArray(); + byte[] certData; + using (Stream resStream = typeof(TestResourceHelper).GetTypeInfo().Assembly.GetManifestResourceStream(typeof(TestResourceHelper).Namespace + "." + "contoso.com.pfx")) + using (var memStream = new MemoryStream()) + { + resStream.CopyTo(memStream); + certData = memStream.ToArray(); + } + testCert2 = _testCert2 = new X509Certificate2(certData, "password"); } - - return new X509Certificate2(certData, "password"); + return testCert2; } } } \ No newline at end of file diff --git a/test/DotNetty.Transport.Tests/Channel/Sockets/SocketDatagramChannelMulticastTest.cs b/test/DotNetty.Transport.Tests/Channel/Sockets/SocketDatagramChannelMulticastTest.cs index c0905417b..71337e90e 100644 --- a/test/DotNetty.Transport.Tests/Channel/Sockets/SocketDatagramChannelMulticastTest.cs +++ b/test/DotNetty.Transport.Tests/Channel/Sockets/SocketDatagramChannelMulticastTest.cs @@ -94,7 +94,7 @@ public static IEnumerable GetData() } [Theory] - [MemberData(nameof(GetData))] + [MemberData(nameof(GetData), DisableDiscoveryEnumeration = true)] public void Multicast(AddressFamily addressFamily, IByteBufferAllocator allocator) { if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) diff --git a/test/DotNetty.Transport.Tests/Channel/Sockets/SocketDatagramChannelUnicastTest.cs b/test/DotNetty.Transport.Tests/Channel/Sockets/SocketDatagramChannelUnicastTest.cs index 8e9a93cd1..d34fe9946 100644 --- a/test/DotNetty.Transport.Tests/Channel/Sockets/SocketDatagramChannelUnicastTest.cs +++ b/test/DotNetty.Transport.Tests/Channel/Sockets/SocketDatagramChannelUnicastTest.cs @@ -144,7 +144,7 @@ public static IEnumerable GetData() } [Theory] - [MemberData(nameof(GetData))] + [MemberData(nameof(GetData), DisableDiscoveryEnumeration = true)] public void SimpleSend(IByteBuffer source, bool bindClient, IByteBufferAllocator allocator, AddressFamily addressFamily, byte[] expectedData, int count) { if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))