Skip to content

Commit

Permalink
More debug info for PrimaryRole test
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCraver committed Oct 31, 2023
1 parent 21b252f commit f270e66
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/StackExchange.Redis.Tests/RoleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ public Roles(ITestOutputHelper output, SharedConnectionFixture fixture) : base(o
public void PrimaryRole(bool allowAdmin) // should work with or without admin now
{
using var conn = Create(allowAdmin: allowAdmin);

Check failure on line 19 in tests/StackExchange.Redis.Tests/RoleTests.cs

View workflow job for this annotation

GitHub Actions / StackExchange.Redis (Windows Server 2022)

Roles.PrimaryRole(allowAdmin: False)(RESP2)

Assert.NotEmpty() Failure: Collection was empty

Check failure on line 19 in tests/StackExchange.Redis.Tests/RoleTests.cs

View workflow job for this annotation

GitHub Actions / StackExchange.Redis (Windows Server 2022)

Roles.PrimaryRole(allowAdmin: True)(RESP2)

Assert.NotEmpty() Failure: Collection was empty

Check failure on line 19 in tests/StackExchange.Redis.Tests/RoleTests.cs

View workflow job for this annotation

GitHub Actions / Tests Results - Windows Server 2022

StackExchange.Redis.Tests.Roles ► Roles.PrimaryRole(allowAdmin: False)(RESP2)

Failed test found in: test-results/runneradmin_fv-az282-123_2023-10-31_12_45_42.trx test-results/runneradmin_fv-az282-123_2023-10-31_12_45_42.trx Error: Assert.NotEmpty() Failure: Collection was empty
Raw output
Assert.NotEmpty() Failure: Collection was empty
   at StackExchange.Redis.Tests.Roles.PrimaryRole(Boolean allowAdmin) in D:\a\StackExchange.Redis\StackExchange.Redis\tests\StackExchange.Redis.Tests\RoleTests.cs:line 19
var server = conn.GetServers().First(conn => !conn.IsReplica);
var servers = conn.GetServers();
Log("Server list:");
foreach (var s in servers)
{
Log($" Server: {s.EndPoint} (isConnected: {s.IsConnected}, isReplica: {s.IsReplica})");
}
var server = servers.First(conn => !conn.IsReplica);

var role = server.Role();
Assert.NotNull(role);
Expand Down

0 comments on commit f270e66

Please sign in to comment.