Skip to content

Commit 8fffdff

Browse files
authored
Tests: Improve stability for AbortOnConnectFailTests (#2934)
* Tests: Improve stability for AbortOnConnectFailTests These had a lot timeout for runtime due to a shared method for faster test execution but in the day but the success case _should_ be fast but worst case it should not fail - we'd much rather it occasionally take a second than fail the test suite and add noise to the process. * Use Vampire/setup-wsl@v6 Fixes a few issues and transitions us to WSL2 underneath - let's see how this works * Revert "Use Vampire/setup-wsl@v6" This reverts commit 90c1c3e.
1 parent f6e8b64 commit 8fffdff

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/StackExchange.Redis.Tests/AbortOnConnectFailTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,16 @@ public async Task DisconnectAndNoReconnectThrowsConnectionExceptionAsync()
8181
}
8282

8383
private ConnectionMultiplexer GetFailFastConn() =>
84-
ConnectionMultiplexer.Connect(GetOptions(BacklogPolicy.FailFast, 400).Apply(o => o.EndPoints.Add($"doesnot.exist.{Guid.NewGuid():N}:6379")), Writer);
84+
ConnectionMultiplexer.Connect(GetOptions(BacklogPolicy.FailFast, duration: 400, connectTimeout: 500).Apply(o => o.EndPoints.Add($"doesnot.exist.{Guid.NewGuid():N}:6379")), Writer);
8585

8686
private ConnectionMultiplexer GetWorkingBacklogConn() =>
87-
ConnectionMultiplexer.Connect(GetOptions(BacklogPolicy.Default, 1000).Apply(o => o.EndPoints.Add(GetConfiguration())), Writer);
87+
ConnectionMultiplexer.Connect(GetOptions(BacklogPolicy.Default).Apply(o => o.EndPoints.Add(GetConfiguration())), Writer);
8888

89-
private static ConfigurationOptions GetOptions(BacklogPolicy policy, int duration) => new ConfigurationOptions()
89+
private static ConfigurationOptions GetOptions(BacklogPolicy policy, int duration = 1000, int connectTimeout = 2000) => new ConfigurationOptions()
9090
{
9191
AbortOnConnectFail = false,
9292
BacklogPolicy = policy,
93-
ConnectTimeout = 500,
93+
ConnectTimeout = connectTimeout,
9494
SyncTimeout = duration,
9595
KeepAlive = duration,
9696
AllowAdmin = true,

0 commit comments

Comments
 (0)