Adds logging and connectivity check.
This commit is contained in:
parent
8f61c46ff0
commit
0a8928b5aa
|
@ -1,4 +1,5 @@
|
|||
using DistTestCore.Codex;
|
||||
using DistTestCore.Helpers;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace ContinuousTests.Tests
|
||||
|
@ -10,10 +11,23 @@ namespace ContinuousTests.Tests
|
|||
public override TestFailMode TestFailMode => TestFailMode.AlwaysRunAllMoments;
|
||||
|
||||
[TestMoment(t: 0)]
|
||||
public void CheckConnectivity()
|
||||
{
|
||||
var checker = new PeerConnectionTestHelpers(Log);
|
||||
checker.AssertFullyConnected(Nodes);
|
||||
}
|
||||
|
||||
[TestMoment(t: 10)]
|
||||
public void CheckRoutingTables()
|
||||
{
|
||||
var allIds = Nodes.Select(n => n.GetDebugInfo().table.localNode.nodeId).ToArray();
|
||||
var allInfos = Nodes.Select(n =>
|
||||
{
|
||||
var info = n.GetDebugInfo();
|
||||
Log.Log($"{n.GetName()} = {info.table.localNode.nodeId}");
|
||||
return info;
|
||||
}).ToArray();
|
||||
|
||||
var allIds = allInfos.Select(i => i.table.localNode.nodeId).ToArray();
|
||||
var errors = Nodes.Select(n => AreAllPresent(n, allIds)).Where(s => !string.IsNullOrEmpty(s)).ToArray();
|
||||
|
||||
if (errors.Any())
|
||||
|
@ -30,7 +44,8 @@ namespace ContinuousTests.Tests
|
|||
|
||||
if (!expected.All(ex => known.Contains(ex)))
|
||||
{
|
||||
return $"Not all of '{string.Join(",", expected)}' were present in routing table: '{string.Join(",", known)}'";
|
||||
var nl = Environment.NewLine;
|
||||
return $"Not all of{nl}'{string.Join(",", expected)}'{nl}were present in routing table:{nl}'{string.Join(",", known)}'";
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
|
|
Loading…
Reference in New Issue