Skip to content

Commit 167434b

Browse files
committed
add more context on ConfigGet test failure
1 parent 8004eb2 commit 167434b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/StackExchange.Redis.Tests/ConfigTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,16 @@ public async Task GetInfo()
442442
}
443443
var cpuCount = cpu.Count();
444444
Assert.True(cpuCount > 2);
445+
if (cpu.Key != "CPU")
446+
{
447+
// seem to be seeing this in logs; add lots of detail
448+
var sb = new StringBuilder("Expected CPU, got ").AppendLine(cpu.Key);
449+
foreach (var setting in cpu)
450+
{
451+
sb.Append(setting.Key).Append('=').AppendLine(setting.Value);
452+
}
453+
Assert.Fail(sb.ToString());
454+
}
445455
Assert.Equal("CPU", cpu.Key);
446456
Assert.Contains(cpu, x => x.Key == "used_cpu_sys");
447457
Assert.Contains(cpu, x => x.Key == "used_cpu_user");

0 commit comments

Comments
 (0)