From e164ad1a3ccae1caa55cd47e9d9124546510e659 Mon Sep 17 00:00:00 2001
From: SilverFox <yyjdelete@126.com>
Date: Sun, 23 May 2021 14:43:27 +0800
Subject: [PATCH 1/7] Add Assert for TlsHandler.MediationStream

---
 .../Tls/TlsHandler.MediationStream.NetCore.cs                | 5 +++++
 .../Tls/TlsHandler.MediationStream.NetFx.cs                  | 3 +++
 .../Tls/TlsHandler.MediationStream.NetStandard20.cs          | 3 +++
 3 files changed, 11 insertions(+)

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<byte> source)
             {
+                Debug.Assert(SourceReadableBytes == 0);
                 _input = source;
                 _inputOffset = 0;
                 _inputLength = 0;
@@ -46,7 +47,9 @@ public void SetSource(in ReadOnlyMemory<byte> 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<int> ReadAsync(Memory<byte> buffer, CancellationToken
                     return new ValueTask<int>(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;
             }
 

From 090b92dbe5729e03efe2d79f6e8e6cf209fffd13 Mon Sep 17 00:00:00 2001
From: SilverFox <yyjdelete@126.com>
Date: Sun, 23 May 2021 19:39:07 +0800
Subject: [PATCH 2/7] The old dotnetty.com.pfx use Sha1+RSA1024 instead of
 Sha256+RSA2048, and seems obsoleted and no longer work on net5.0+ubuntu20.04

Generated with
```
openssl genrsa -out ssl.key 2048
openssl req -new -x509 -key ssl.key -out dotnetty.com.cer -days 3650 -subj /CN=dotnetty.com
openssl req -new -x509 -key ssl.key -out contoso.com.cer -days 3650 -subj /CN=contoso.com
openssl pkcs12 -export -out dotnetty.com.pfx -inkey ssl.key -in dotnetty.com.cer
openssl pkcs12 -export -out contoso.com.pfx -inkey ssl.key -in contoso.com.cer
```
password="password"
---
 shared/contoso.com.pfx  | Bin 2503 -> 2389 bytes
 shared/dotnetty.com.pfx | Bin 1710 -> 2389 bytes
 2 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/shared/contoso.com.pfx b/shared/contoso.com.pfx
index bacddeff76af91e5bae2b9bc3962c7b85d2e0602..a864470785b837a487d8ed30c906012839f6af22 100644
GIT binary patch
literal 2389
zcmY+EX*d*$9*51Ek=+<4CymG;hOsuo8EfHGwk(NZnhM!N98yDL8~YYDWNR#0N0x{Q
zN1Y;N?80Qr7$jSEM{YgOz4zSv;s51*pXdMW{b49DYajrGp}-`du+uSSG1~%wBY*-5
zj2BFSfq!5g3<cEqkAfCZKu>?5A|T+W$^FLwFvp>M|Ng)afMNu}ymr%{i<Gjlwm={+
zPXq;Y>+5@{+Z8;iXdYDS+yK=Vln_fiNNLv@dNRS?EKl37lU&yoxr(d-V8@+^op?WW
z6Djw<Xe!NnIA^mVSG;?aAuFG=azTE)2SsW~BLzR4*5bPr(w{5nX&~<2E8EW3*P$Ke
zZ8>&mHq#&Vn3Aku!Xfc$J+2wUUe>ruwF&KmIJh5bhRO@?b=XNJz1;f9gO%5I{bC+j
zVtq*Ce<bk2;Icxk?_S@C*}8Ov2ER8z?s9~2xvBP(PH0o=6#cb?rtbNQ)yYq+X#S(8
z((baKxG!VWGH8!_jnijP=r`0q<4RwLWQWW7a6RIe?X~K<UL2p@VQ5I2s-ER2e+BXo
z*dZO3<Nnpez)9~~rg+ft=9SRb9$d@KLTwxxKemz|_ouQb<KWbQXwNJylT^Vtlth}B
zd}~*w2RxuC|B|{Kkbbr!W&j_?D2uZ1c=U~(F)SLH%z&ej0%XE|qRrb+(rNHUPlI1a
zXV|&F8bC?U`4+OWjrp|uF*|$1SyQ}^zOM$W4srV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K?2gmqS9pnkU&GcR
zVKB*wVo81~B^9u1Xic|+cRs5WzKqZm6Mba%-_b7K&}XgDwqPY|J}}leNcG)#-Kla=
z>sFo?_letxnLpiz=Hts8VqGF?vJ<AJu5Qz9!BJx_49ODjDsBY+`F=u!GV85s%RakT
zWuQTr&d`gd+4JZ0t1(6AcH6ZOr`W}9kJe<P^r+`@3?oAeZ7v4hq!`%o#Rtn9H{|Ks
zA6-qI&r~`^c=A!)(V6nG_ICI6PxK<Ed{NZcIKIN=ty~?2516W@F6In{{Hk!tR64?!
zeyW`K?ANY(<nk3t{&==--Ddioc}o@dh%m2Q>!Y0Q5#4pE1AeGd;i%Rzv>Fn2Vrbe<
zH+|K8MvD44jV8g0f|?_lZ-<rBzU!59o8QgY)vxoGu0iXlCm}Y-N(6^hGEqaLbTC9U
w*%zNh7K6K8muS%Cp*3y$yro7MVgn?wT{Kf0BPaMYIT$e5p?~=pFMPzm0rq0z+yDRo


From 8ade2abdb55b9c6a1703d3b29b96025c8314adb2 Mon Sep 17 00:00:00 2001
From: SilverFox <yyjdelete@126.com>
Date: Sun, 23 May 2021 21:47:21 +0800
Subject: [PATCH 3/7] Ignore SslProtocols not avaliable on current platform in
 TlsHandlerTest

---
 .../DotNetty.Handlers.Tests/SniHandlerTest.cs |  24 +--
 .../DotNetty.Handlers.Tests/TlsHandlerTest.cs | 153 ++++++++++++++----
 .../TestResourceHelper.cs                     |  38 +++--
 3 files changed, 156 insertions(+), 59 deletions(-)

diff --git a/test/DotNetty.Handlers.Tests/SniHandlerTest.cs b/test/DotNetty.Handlers.Tests/SniHandlerTest.cs
index 9ca2e9ca2..605dd4c71 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<object[]> 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<IWriteStrategy>[]
             {
         () => new AsIsWriteStrategy()
@@ -106,7 +98,8 @@ public async Task TlsRead(int[] frameLengths, bool isClient, IWriteStrategy writ
 #pragma warning disable CS1998 // 异步方法缺少 "await" 运算符,将以同步方式运行
                 await ReadOutboundAsync(async () => ch.ReadInbound<IByteBuffer>(), 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<object[]> 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..0431c6e91 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,30 @@ public static IEnumerable<object[]> GetTlsReadTestData()
                     Enumerable.Repeat(0, 30).Select(_ => random.Next(0, 17000)).ToArray()
                 };
             var boolToggle = new[] { false, true };
-            var protocols = new List<Tuple<SslProtocols, SslProtocols>>();
-            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));
+            var protocols = new List<(SslProtocols serverProtocol, SslProtocols clientProtocol)>();
+            protocols.Add((SslProtocols.Tls, SslProtocols.Tls));
+            protocols.Add((SslProtocols.Tls11, SslProtocols.Tls11));
+            protocols.Add((SslProtocols.Tls12, SslProtocols.Tls12));
 #if NETCOREAPP_3_0_GREATER
-                //protocols.Add(Tuple.Create(SslProtocols.Tls13, SslProtocols.Tls13));
+            var tls13 = SslProtocols.Tls13;
+            protocols.Add((tls13, tls13));
+#else
+            var tls13 = SslProtocols.None;
 #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));
+            if ((Platform.SupportedSslProtocols & tls13) != SslProtocols.None)
+            {
+                //Tls and Tls11 maybe unavailable in new platforms
+                protocols.Add((SslProtocols.Tls12 | tls13, SslProtocols.Tls11 | SslProtocols.Tls12));
+                protocols.Add((SslProtocols.Tls11 | SslProtocols.Tls12, SslProtocols.Tls12 | tls13));
             }
             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));
+                protocols.Add((SslProtocols.Tls12 | SslProtocols.Tls, SslProtocols.Tls12 | SslProtocols.Tls11));
+                protocols.Add((SslProtocols.Tls | SslProtocols.Tls12, SslProtocols.Tls | SslProtocols.Tls11));
             }
+
+            protocols = FilterPlatformAvailableProtocols(protocols);
+
             var writeStrategyFactories = new Func<IWriteStrategy>[]
             {
                 () => new AsIsWriteStrategy(),
@@ -79,7 +85,7 @@ 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 };
         }
 
 
@@ -147,31 +153,35 @@ public static IEnumerable<object[]> 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<Tuple<SslProtocols, SslProtocols>>();
-            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));
+            var protocols = new List<(SslProtocols serverProtocol, SslProtocols clientProtocol)>();
+            protocols.Add((SslProtocols.Tls, SslProtocols.Tls));
+            protocols.Add((SslProtocols.Tls11, SslProtocols.Tls11));
+            protocols.Add((SslProtocols.Tls12, SslProtocols.Tls12));
 #if NETCOREAPP_3_0_GREATER
-                //protocols.Add(Tuple.Create(SslProtocols.Tls13, SslProtocols.Tls13));
+            var tls13 = SslProtocols.Tls13;
+            protocols.Add((tls13, tls13));
+#else
+            var tls13 = SslProtocols.None;
 #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));
+            if ((Platform.SupportedSslProtocols & tls13) != SslProtocols.None)
+            {
+                //Tls and Tls11 maybe unavailable in new platforms
+                protocols.Add((SslProtocols.Tls12 | tls13, SslProtocols.Tls11 | SslProtocols.Tls12));
+                protocols.Add((SslProtocols.Tls11 | SslProtocols.Tls12, SslProtocols.Tls12 | tls13));
             }
             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));
+                protocols.Add((SslProtocols.Tls12 | SslProtocols.Tls, SslProtocols.Tls12 | SslProtocols.Tls11));
+                protocols.Add((SslProtocols.Tls | SslProtocols.Tls12, SslProtocols.Tls | SslProtocols.Tls11));
             }
 
+            protocols = FilterPlatformAvailableProtocols(protocols);
+
             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 };
         }
 
         [Theory]
@@ -232,6 +242,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.SupportedSslProtocols;
+            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<Tuple<EmbeddedChannel, SslStream>> SetupStreamAndChannelAsync(bool isClient, IEventExecutor executor, IWriteStrategy writeStrategy, SslProtocols serverProtocol, SslProtocols clientProtocol, List<Task> writeTasks)
         {
             X509Certificate2 tlsCertificate = TestResourceHelper.GetTestCertificate();
@@ -378,5 +413,65 @@ public override void ChannelActive(IChannelHandlerContext context)
                 }
             }
         }
+
+        public static class Platform
+        {
+            public static readonly SslProtocols SupportedSslProtocols;
+            static Platform()
+            {
+                SslProtocols protocol = 0;
+                protocol |= CheckSslProtocol(SslProtocols.Tls);
+                protocol |= CheckSslProtocol(SslProtocols.Tls11);
+                protocol |= CheckSslProtocol(SslProtocols.Tls12);
+#if NETCOREAPP_3_0_GREATER
+                protocol |= CheckSslProtocol(SslProtocols.Tls13);
+#endif
+                SupportedSslProtocols = protocol;
+            }
+
+            private static SslProtocols 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))
+                        {
+                            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))
+                            {
+                                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 protocol;
+                }
+                catch (AuthenticationException)
+                {
+                    return SslProtocols.None;
+                }
+            }
+        }
     }
 }
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

From 6cc270d2f7b4ca59621b1cfb0af99cbf62450628 Mon Sep 17 00:00:00 2001
From: SilverFox <yyjdelete@126.com>
Date: Sun, 23 May 2021 22:05:20 +0800
Subject: [PATCH 4/7] Move test of SslProtocols to an independent group, no
 need to run too many tests for it

---
 .../DotNetty.Handlers.Tests/TlsHandlerTest.cs | 101 +++++++++++-------
 1 file changed, 63 insertions(+), 38 deletions(-)

diff --git a/test/DotNetty.Handlers.Tests/TlsHandlerTest.cs b/test/DotNetty.Handlers.Tests/TlsHandlerTest.cs
index 0431c6e91..9a965b466 100644
--- a/test/DotNetty.Handlers.Tests/TlsHandlerTest.cs
+++ b/test/DotNetty.Handlers.Tests/TlsHandlerTest.cs
@@ -48,6 +48,49 @@ public static IEnumerable<object[]> GetTlsReadTestData()
                     Enumerable.Repeat(0, 30).Select(_ => random.Next(0, 17000)).ToArray()
                 };
             var boolToggle = new[] { false, true };
+            var protocols = new (SslProtocols serverProtocol, SslProtocols clientProtocol)[] { (SslProtocols.None, SslProtocols.None) };
+
+            var writeStrategyFactories = new Func<IWriteStrategy>[]
+            {
+                () => new AsIsWriteStrategy(),
+                () => new BatchingWriteStrategy(1, TimeSpan.FromMilliseconds(20), true),
+                () => new BatchingWriteStrategy(4096, TimeSpan.FromMilliseconds(20), true),
+                () => new BatchingWriteStrategy(32 * 1024, TimeSpan.FromMilliseconds(20), false)
+            };
+
+            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 };
+        }
+
+        public static IEnumerable<object[]> GetTlsReadTestProtocol()
+        {
+            var lengthVariations =
+                new[]
+                {
+                    new[] { 1 },
+                };
+            var boolToggle = new[] { false, true };
+            var protocols = GetTlsTestProtocol();
+
+            var writeStrategyFactories = new Func<IWriteStrategy>[]
+            {
+                () => 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)>();
             protocols.Add((SslProtocols.Tls, SslProtocols.Tls));
             protocols.Add((SslProtocols.Tls11, SslProtocols.Tls11));
@@ -71,26 +114,12 @@ public static IEnumerable<object[]> GetTlsReadTestData()
             }
 
             protocols = FilterPlatformAvailableProtocols(protocols);
-
-            var writeStrategyFactories = new Func<IWriteStrategy>[]
-            {
-                () => new AsIsWriteStrategy(),
-                () => new BatchingWriteStrategy(1, TimeSpan.FromMilliseconds(20), true),
-                () => new BatchingWriteStrategy(4096, TimeSpan.FromMilliseconds(20), true),
-                () => new BatchingWriteStrategy(32 * 1024, TimeSpan.FromMilliseconds(20), false)
-            };
-
-            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 };
+            return protocols;
         }
 
-
         [Theory]
         [MemberData(nameof(GetTlsReadTestData))]
+        [MemberData(nameof(GetTlsReadTestProtocol))]
         public async Task TlsRead(int[] frameLengths, bool isClient, IWriteStrategy writeStrategy, SslProtocols serverProtocol, SslProtocols clientProtocol)
         {
             this.Output.WriteLine($"frameLengths: {string.Join(", ", frameLengths)}");
@@ -153,29 +182,24 @@ public static IEnumerable<object[]> 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<(SslProtocols serverProtocol, SslProtocols clientProtocol)>();
-            protocols.Add((SslProtocols.Tls, SslProtocols.Tls));
-            protocols.Add((SslProtocols.Tls11, SslProtocols.Tls11));
-            protocols.Add((SslProtocols.Tls12, SslProtocols.Tls12));
-#if NETCOREAPP_3_0_GREATER
-            var tls13 = SslProtocols.Tls13;
-            protocols.Add((tls13, tls13));
-#else
-            var tls13 = SslProtocols.None;
-#endif
-            if ((Platform.SupportedSslProtocols & tls13) != SslProtocols.None)
-            {
-                //Tls and Tls11 maybe unavailable in new platforms
-                protocols.Add((SslProtocols.Tls12 | tls13, SslProtocols.Tls11 | SslProtocols.Tls12));
-                protocols.Add((SslProtocols.Tls11 | SslProtocols.Tls12, SslProtocols.Tls12 | tls13));
-            }
-            else
-            {
-                protocols.Add((SslProtocols.Tls12 | SslProtocols.Tls, SslProtocols.Tls12 | SslProtocols.Tls11));
-                protocols.Add((SslProtocols.Tls | SslProtocols.Tls12, SslProtocols.Tls | SslProtocols.Tls11));
-            }
+            var protocols = new (SslProtocols serverProtocol, SslProtocols clientProtocol)[] { (SslProtocols.None, SslProtocols.None) };
 
-            protocols = FilterPlatformAvailableProtocols(protocols);
+            return
+                from frameLengths in lengthVariations
+                from isClient in boolToggle
+                from protocol in protocols
+                select new object[] { frameLengths, isClient, protocol.serverProtocol, protocol.clientProtocol };
+        }
+
+        public static IEnumerable<object[]> GetTlsWriteTestProtocol()
+        {
+            var lengthVariations =
+                new[]
+                {
+                    new[] { 1 }
+                };
+            var boolToggle = new[] { false, true };
+            var protocols = GetTlsTestProtocol();
 
             return
                 from frameLengths in lengthVariations
@@ -186,6 +210,7 @@ from protocol in protocols
 
         [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)}");

From 9c9e5e49801ab98af942389510ddb33b8c241011 Mon Sep 17 00:00:00 2001
From: SilverFox <yyjdelete@126.com>
Date: Sun, 23 May 2021 22:43:29 +0800
Subject: [PATCH 5/7] Add an assert to ensure proper protocol is used by ssl
 handshake

---
 test/DotNetty.Handlers.Tests/TlsHandlerTest.cs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/test/DotNetty.Handlers.Tests/TlsHandlerTest.cs b/test/DotNetty.Handlers.Tests/TlsHandlerTest.cs
index 9a965b466..0679d4dd2 100644
--- a/test/DotNetty.Handlers.Tests/TlsHandlerTest.cs
+++ b/test/DotNetty.Handlers.Tests/TlsHandlerTest.cs
@@ -343,6 +343,9 @@ static async Task<Tuple<EmbeddedChannel, SslStream>> 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);

From e0802baa2bf801c6c5dc85064f5bbaaead2c8fb6 Mon Sep 17 00:00:00 2001
From: SilverFox <yyjdelete@126.com>
Date: Sun, 23 May 2021 23:09:43 +0800
Subject: [PATCH 6/7] Rework ssl handShake test with new assert

---
 .../DotNetty.Handlers.Tests/TlsHandlerTest.cs | 107 ++++++++++--------
 1 file changed, 60 insertions(+), 47 deletions(-)

diff --git a/test/DotNetty.Handlers.Tests/TlsHandlerTest.cs b/test/DotNetty.Handlers.Tests/TlsHandlerTest.cs
index 0679d4dd2..907ba25b3 100644
--- a/test/DotNetty.Handlers.Tests/TlsHandlerTest.cs
+++ b/test/DotNetty.Handlers.Tests/TlsHandlerTest.cs
@@ -92,25 +92,21 @@ from protocol in protocols
         static List<(SslProtocols serverProtocol, SslProtocols clientProtocol)> GetTlsTestProtocol()
         {
             var protocols = new List<(SslProtocols serverProtocol, SslProtocols clientProtocol)>();
-            protocols.Add((SslProtocols.Tls, SslProtocols.Tls));
-            protocols.Add((SslProtocols.Tls11, SslProtocols.Tls11));
-            protocols.Add((SslProtocols.Tls12, SslProtocols.Tls12));
-#if NETCOREAPP_3_0_GREATER
-            var tls13 = SslProtocols.Tls13;
-            protocols.Add((tls13, tls13));
-#else
-            var tls13 = SslProtocols.None;
-#endif
-            if ((Platform.SupportedSslProtocols & tls13) != SslProtocols.None)
+            var supportedProtocolList = Platform.SupportedSslProtocolList;
+            foreach (var cur in supportedProtocolList)
             {
-                //Tls and Tls11 maybe unavailable in new platforms
-                protocols.Add((SslProtocols.Tls12 | tls13, SslProtocols.Tls11 | SslProtocols.Tls12));
-                protocols.Add((SslProtocols.Tls11 | SslProtocols.Tls12, SslProtocols.Tls12 | tls13));
+                protocols.Add((cur, cur));
             }
-            else
+            int handShakeTestCnt = 0;
+            var supportedProtocols = Platform.AllSupportedSslProtocols;
+            foreach (var cur in supportedProtocolList)
             {
-                protocols.Add((SslProtocols.Tls12 | SslProtocols.Tls, SslProtocols.Tls12 | SslProtocols.Tls11));
-                protocols.Add((SslProtocols.Tls | SslProtocols.Tls12, SslProtocols.Tls | SslProtocols.Tls11));
+                protocols.Add((cur, supportedProtocols));
+                protocols.Add((supportedProtocols, cur));
+
+                handShakeTestCnt++;
+                if (handShakeTestCnt >= 2)
+                    break;
             }
 
             protocols = FilterPlatformAvailableProtocols(protocols);
@@ -275,7 +271,7 @@ await ReadOutboundAsync(
             //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.SupportedSslProtocols;
+            var supportedSslProtocols = Platform.AllSupportedSslProtocols;
             if (supportedSslProtocols != SslProtocols.None)
             {
                 foreach (var cur in protocols)
@@ -444,20 +440,34 @@ public override void ChannelActive(IChannelHandlerContext context)
 
         public static class Platform
         {
-            public static readonly SslProtocols SupportedSslProtocols;
+            public static readonly SslProtocols AllSupportedSslProtocols;
+            public static readonly IReadOnlyList<SslProtocols> SupportedSslProtocolList;
             static Platform()
             {
-                SslProtocols protocol = 0;
-                protocol |= CheckSslProtocol(SslProtocols.Tls);
-                protocol |= CheckSslProtocol(SslProtocols.Tls11);
-                protocol |= CheckSslProtocol(SslProtocols.Tls12);
+                var allProtocol = new[]
+                {
+                    SslProtocols.Tls,
+                    SslProtocols.Tls11,
+                    SslProtocols.Tls12,
 #if NETCOREAPP_3_0_GREATER
-                protocol |= CheckSslProtocol(SslProtocols.Tls13);
+                    SslProtocols.Tls13,
 #endif
-                SupportedSslProtocols = protocol;
+                };
+                var protocols = SslProtocols.None;
+                var list = new List<SslProtocols>();
+                foreach (var cur in allProtocol)
+                {
+                    if (CheckSslProtocol(cur))
+                    {
+                        protocols |= cur;
+                        list.Add(cur);
+                    }
+                }
+                AllSupportedSslProtocols = protocols;
+                SupportedSslProtocolList = list.AsReadOnly();
             }
 
-            private static SslProtocols CheckSslProtocol(SslProtocols protocol)
+            private static bool CheckSslProtocol(SslProtocols protocol)
             {
                 X509Certificate2 tlsCertificate = TestResourceHelper.GetTestCertificate();
                 string targetHost = tlsCertificate.GetNameInfo(X509NameType.SimpleName, false);
@@ -469,35 +479,38 @@ private static SslProtocols CheckSslProtocol(SslProtocols protocol)
                         server.Listen(1);
                         using (var client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
                         {
-                            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))
+                            Task.Run(async () =>
                             {
-                                Task.WhenAll(
-                                    Task.Run(async () =>
-                                    {
-                                        using (b)
+                                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 () =>
                                         {
-                                            await b.AuthenticateAsClientAsync(targetHost, null, protocol, false);
-                                            Debug.Assert(b.SslProtocol == protocol);
-                                        }
-                                    }),
-                                    Task.Run(async () =>
-                                    {
-                                        using (a)
+                                            using (b)
+                                            {
+                                                await b.AuthenticateAsClientAsync(targetHost, null, protocol, false);
+                                                Debug.Assert(b.SslProtocol == protocol);
+                                            }
+                                        }),
+                                        Task.Run(async () =>
                                         {
-                                            await a.AuthenticateAsServerAsync(tlsCertificate, false, protocol, false);
-                                            Debug.Assert(a.SslProtocol == protocol);
-                                        }
-                                    })).WithTimeout(TimeSpan.FromSeconds(1)).GetAwaiter().GetResult();
-                            }
+                                            using (a)
+                                            {
+                                                await a.AuthenticateAsServerAsync(tlsCertificate, false, protocol, false);
+                                                Debug.Assert(a.SslProtocol == protocol);
+                                            }
+                                        }));
+                                }
+                            }).WithTimeout(TimeSpan.FromSeconds(1)).GetAwaiter().GetResult();
                         }
                     }
-                    return protocol;
+                    return true;
                 }
-                catch (AuthenticationException)
+                catch
                 {
-                    return SslProtocols.None;
+                    return false;
                 }
             }
         }

From ae2874b93f6a5215f5f83269a6abb1c11020bb22 Mon Sep 17 00:00:00 2001
From: SilverFox <yyjdelete@126.com>
Date: Mon, 24 May 2021 22:10:41 +0800
Subject: [PATCH 7/7] set DisableDiscoveryEnumeration = true for
 non-serializable MemberData

---
 .../HttpServerKeepAliveHandlerTest.cs         |  6 +-
 test/DotNetty.Codecs.Http2.Tests/HpackTest.cs |  2 +-
 .../RoundTripTests.cs                         |  2 +-
 .../DotNetty.Handlers.Tests/SniHandlerTest.cs |  2 +-
 .../DotNetty.Handlers.Tests/TlsHandlerTest.cs |  4 +-
 .../AbstractSocketShutdownOutputByPeerTest.cs |  4 +-
 .../CompositeBufferGatheringWriteTest.cs      | 16 +++---
 .../Transport/Socket/SocketAutoReadTest.cs    |  8 +--
 .../Transport/Socket/SocketBufReleaseTest.cs  |  8 +--
 .../Transport/Socket/SocketCancelWriteTest.cs |  8 +--
 .../SocketConditionalWritabilityTest.cs       |  8 +--
 .../Transport/Socket/SocketConnectTest.cs     | 16 +++---
 .../Socket/SocketDataReadInitialStateTest.cs  | 16 +++---
 .../Transport/Socket/SocketEchoTest.cs        | 56 +++++++++----------
 .../Socket/SocketExceptionHandlingTest.cs     |  8 +--
 .../Socket/SocketFixedLengthEchoTest.cs       | 16 +++---
 .../Socket/SocketGatheringWriteTest.cs        | 40 ++++++-------
 .../Transport/Socket/SocketHalfClosedTest.cs  | 14 ++---
 .../Transport/Socket/SocketReadPendingTest.cs |  8 +--
 .../Transport/Socket/SocketRstTest.cs         | 16 +++---
 .../Transport/Socket/SocketStringEchoTest.cs  | 16 +++---
 .../Socket/WriteBeforeRegisteredTest.cs       |  4 +-
 .../SocketDatagramChannelMulticastTest.cs     |  2 +-
 .../SocketDatagramChannelUnicastTest.cs       |  2 +-
 24 files changed, 141 insertions(+), 141 deletions(-)

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<object[]> 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<object[]> 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<object[]> 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 605dd4c71..695d3cfc7 100644
--- a/test/DotNetty.Handlers.Tests/SniHandlerTest.cs
+++ b/test/DotNetty.Handlers.Tests/SniHandlerTest.cs
@@ -66,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)}");
diff --git a/test/DotNetty.Handlers.Tests/TlsHandlerTest.cs b/test/DotNetty.Handlers.Tests/TlsHandlerTest.cs
index 907ba25b3..14d4ff9b3 100644
--- a/test/DotNetty.Handlers.Tests/TlsHandlerTest.cs
+++ b/test/DotNetty.Handlers.Tests/TlsHandlerTest.cs
@@ -114,8 +114,8 @@ from protocol in protocols
         }
 
         [Theory]
-        [MemberData(nameof(GetTlsReadTestData))]
-        [MemberData(nameof(GetTlsReadTestProtocol))]
+        [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)}");
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.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<object[]> 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<object[]> 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))