Skip to content

Commit

Permalink
Add DemandReplica two replicas test
Browse files Browse the repository at this point in the history
  • Loading branch information
Грумов Никита committed Sep 15, 2023
1 parent 106cd2d commit f3e325a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/StackExchange.Redis.Tests/SentinelTwoReplicasTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ public async Task PrimaryConnectTest()
Assert.Equal(expected, value);
}

[Fact]
public async Task ReplicasRoundRobinServerSelectionTest()
[Theory]
[InlineData(CommandFlags.DemandReplica)]
[InlineData(CommandFlags.PreferReplica)]
public async Task ReplicasRoundRobinServerSelectionTest(CommandFlags replicaFlags)
{
var connectionString = $"{TestConfig.Current.SentinelServer}:{TestConfig.Current.SentinelTwoReplicasPortA},serviceName={ServiceOptions.ServiceName},allowAdmin=true";
using var conn = await ConnectionMultiplexer.ConnectAsync(connectionString);
Expand Down Expand Up @@ -98,7 +100,7 @@ public async Task ReplicasRoundRobinServerSelectionTest()
conn.RegisterProfiler(() => profilingSession);
for (var i = 0; i < 100; i++)
{
await db.StringGetAsync(key, CommandFlags.DemandReplica);
await db.StringGetAsync(key, replicaFlags);
}

var commands = profilingSession.FinishProfiling();
Expand Down

0 comments on commit f3e325a

Please sign in to comment.