diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/DualModeSocketTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/DualModeSocketTest.cs index eb229d9d37e3f..dd9dbb64b8ec1 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/DualModeSocketTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/DualModeSocketTest.cs @@ -788,7 +788,6 @@ public void BeginAcceptV4BoundToSpecificV4_Success() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/45810", TestRuntimes.Mono)] public void BeginAcceptV4BoundToAnyV4_Success() { DualModeConnect_BeginAccept_Helper(IPAddress.Any, IPAddress.Loopback); @@ -850,6 +849,13 @@ private void DualModeConnect_BeginAccept_Helper(IPAddress listenOn, IPAddress co serverSocket.Listen(1); IAsyncResult async = serverSocket.BeginAccept(null, null); SocketClient client = new SocketClient(_log, serverSocket, connectTo, port); + + Assert.True( + client.WaitHandle.WaitOne(TestSettings.PassingTestTimeout), + "Timed out while waiting for connection"); + Assert.True( + async.AsyncWaitHandle.WaitOne(TestSettings.PassingTestTimeout), + "Timed out while waiting to accept the client"); // Due to the nondeterministic nature of calling dispose on a Socket that is doing // an EndAccept operation, we expect two types of exceptions to happen. @@ -872,10 +878,6 @@ private void DualModeConnect_BeginAccept_Helper(IPAddress listenOn, IPAddress co catch (ObjectDisposedException) { } catch (SocketException) { } - Assert.True( - client.WaitHandle.WaitOne(TestSettings.PassingTestTimeout), - "Timed out while waiting for connection"); - if (client.Error != SocketError.Success) { throw new SocketException((int)client.Error);