Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 152ddcf

Browse files
committed
Add NetworkRedisSentinelFailoverTests
1 parent dcc88f1 commit 152ddcf

File tree

6 files changed

+38
-4
lines changed

6 files changed

+38
-4
lines changed

lib/signed/ServiceStack.Common.dll

-2.5 KB
Binary file not shown.

lib/signed/ServiceStack.Text.dll

-7 KB
Binary file not shown.

tests/Console.Tests/Console.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
<Reference Include="System.Xml" />
6161
</ItemGroup>
6262
<ItemGroup>
63+
<Compile Include="NetworkRedisSentinelFailoverTests.cs" />
6364
<Compile Include="GoogleRedisSentinelFailoverTests.cs" />
6465
<Compile Include="HashCollectionStressTests.cs" />
6566
<Compile Include="HashStressTest.cs" />

tests/Console.Tests/LocalRedisSentinelFailoverTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class LocalRedisSentinelFailoverTests : RedisSentinelFailoverTests
1919
"127.0.0.1:26382",
2020
};
2121

22-
public bool StartAndStopRedisServers = true;
22+
public bool StartAndStopRedisServers = false;
2323

2424
private static void StartRedisServersAndSentinels()
2525
{
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System.Collections.Generic;
2+
using ServiceStack.Redis;
3+
4+
namespace ConsoleTests
5+
{
6+
public class NetworkRedisSentinelFailoverTests : RedisSentinelFailoverTests
7+
{
8+
public static string[] SentinelHosts = new[]
9+
{
10+
"10.0.0.9:26380",
11+
"10.0.0.9:26381",
12+
"10.0.0.9:26382",
13+
};
14+
15+
protected override RedisSentinel CreateSentinel()
16+
{
17+
var sentinel = new RedisSentinel(SentinelHosts)
18+
{
19+
IpAddressMap =
20+
{
21+
{"127.0.0.1", "10.0.0.9"},
22+
}
23+
};
24+
return sentinel;
25+
}
26+
}
27+
}

tests/Console.Tests/Program.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,18 @@ static void Main(string[] args)
1919
//new HashStressTest().Execute("10.0.0.9");
2020
//new HashCollectionStressTests().Execute("10.0.0.9", noOfThreads: 64);
2121

22-
//new LocalRedisSentinelFailoverTests().Execute();
23-
//new LocalRedisSentinelFailoverTests { StartAndStopRedisServers = false }.Execute();
22+
//new LocalRedisSentinelFailoverTests
23+
//{
24+
// StartAndStopRedisServers = true
25+
//}.Execute();
26+
2427
//new LocalRedisSentinelFailoverTests {
2528
// UseRedisManagerPool = true, StartAndStopRedisServers = false }.Execute();
29+
//new LocalRedisSentinelFailoverTests().Execute();
30+
31+
new NetworkRedisSentinelFailoverTests().Execute();
2632

27-
new GoogleRedisSentinelFailoverTests().Execute();
33+
//new GoogleRedisSentinelFailoverTests().Execute();
2834
}
2935
}
3036
}

0 commit comments

Comments
 (0)