Commit 80731aa0 authored by Pavel Pochobut's avatar Pavel Pochobut

correct tear down for ConnectingFailDetection

parent d994b7ad
...@@ -8,7 +8,7 @@ namespace StackExchange.Redis.Tests ...@@ -8,7 +8,7 @@ namespace StackExchange.Redis.Tests
public class ConnectingFailDetection : TestBase public class ConnectingFailDetection : TestBase
{ {
#if DEBUG #if DEBUG
[TestCase] [Test]
public void FastNoticesFailOnConnectingSync() public void FastNoticesFailOnConnectingSync()
{ {
try try
...@@ -34,16 +34,15 @@ public void FastNoticesFailOnConnectingSync() ...@@ -34,16 +34,15 @@ public void FastNoticesFailOnConnectingSync()
Assert.IsTrue(muxer.IsConnected); Assert.IsTrue(muxer.IsConnected);
} }
ClearAmbientFailures();
} }
finally finally
{ {
SocketManager.ConnectCompletionType = CompletionType.Any; SocketManager.ConnectCompletionType = CompletionType.Any;
ClearAmbientFailures();
} }
} }
[TestCase] [Test]
public void ConnectsWhenBeginConnectCompletesSynchronously() public void ConnectsWhenBeginConnectCompletesSynchronously()
{ {
try try
...@@ -57,16 +56,15 @@ public void ConnectsWhenBeginConnectCompletesSynchronously() ...@@ -57,16 +56,15 @@ public void ConnectsWhenBeginConnectCompletesSynchronously()
Assert.IsTrue(muxer.IsConnected); Assert.IsTrue(muxer.IsConnected);
} }
ClearAmbientFailures();
} }
finally finally
{ {
SocketManager.ConnectCompletionType = CompletionType.Any; SocketManager.ConnectCompletionType = CompletionType.Any;
ClearAmbientFailures();
} }
} }
[TestCase] [Test]
public void FastNoticesFailOnConnectingAsync() public void FastNoticesFailOnConnectingAsync()
{ {
try try
...@@ -92,13 +90,12 @@ public void FastNoticesFailOnConnectingAsync() ...@@ -92,13 +90,12 @@ public void FastNoticesFailOnConnectingAsync()
Thread.Sleep(2000); Thread.Sleep(2000);
Assert.IsTrue(muxer.IsConnected); Assert.IsTrue(muxer.IsConnected);
ClearAmbientFailures();
} }
} }
finally finally
{ {
SocketManager.ConnectCompletionType = CompletionType.Any; SocketManager.ConnectCompletionType = CompletionType.Any;
ClearAmbientFailures();
} }
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment