Adds clear logging for peer helper invocations.

This commit is contained in:
benbierens 2023-05-29 09:25:03 +02:00
parent 1016f568b8
commit 8c85cd22bb
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
4 changed files with 7 additions and 0 deletions

View File

@ -21,6 +21,7 @@ namespace DistTestCore.Helpers
public void AssertFullyConnected(params IOnlineCodexNode[] nodes) public void AssertFullyConnected(params IOnlineCodexNode[] nodes)
{ {
test.Debug($"Asserting peers are fully-connected for nodes: '{string.Join(",", nodes.Select(n => n.GetName()))}'...");
var entries = CreateEntries(nodes); var entries = CreateEntries(nodes);
var pairs = CreatePairs(entries); var pairs = CreatePairs(entries);
@ -33,6 +34,7 @@ namespace DistTestCore.Helpers
{ {
Assert.Fail(string.Join(Environment.NewLine, pairs.Select(p => p.GetMessage()))); Assert.Fail(string.Join(Environment.NewLine, pairs.Select(p => p.GetMessage())));
} }
test.Debug($"Success! Peers are fully-connected: {string.Join(",", nodes.Select(n => n.GetName()))}");
} }
private static void RetryWhilePairs(List<Pair> pairs, Action action) private static void RetryWhilePairs(List<Pair> pairs, Action action)

View File

@ -16,6 +16,7 @@
public void AssertFullDownloadInterconnectivity(IEnumerable<IOnlineCodexNode> nodes, ByteSize testFileSize) public void AssertFullDownloadInterconnectivity(IEnumerable<IOnlineCodexNode> nodes, ByteSize testFileSize)
{ {
test.Debug($"Asserting full download interconnectivity for nodes: '{string.Join(",", nodes.Select(n => n.GetName()))}'...");
foreach (var node in nodes) foreach (var node in nodes)
{ {
var uploader = node; var uploader = node;
@ -26,6 +27,8 @@
PerformTest(uploader, downloaders); PerformTest(uploader, downloaders);
}); });
} }
test.Debug($"Success! Full download interconnectivity for nodes: {string.Join(",", nodes.Select(n => n.GetName()))}");
} }
private void PerformTest(IOnlineCodexNode uploader, IOnlineCodexNode[] downloaders) private void PerformTest(IOnlineCodexNode uploader, IOnlineCodexNode[] downloaders)

View File

@ -56,6 +56,7 @@ namespace Tests.PeerDiscoveryTests
private void AssertAllNodesConnected() private void AssertAllNodesConnected()
{ {
PeerConnectionTestHelpers.AssertFullyConnected(GetAllOnlineCodexNodes()); PeerConnectionTestHelpers.AssertFullyConnected(GetAllOnlineCodexNodes());
PeerDownloadTestHelpers.AssertFullDownloadInterconnectivity(GetAllOnlineCodexNodes());
} }
} }
} }

View File

@ -57,6 +57,7 @@ namespace Tests.PeerDiscoveryTests
private void AssertAllNodesConnected() private void AssertAllNodesConnected()
{ {
PeerConnectionTestHelpers.AssertFullyConnected(GetAllOnlineCodexNodes()); PeerConnectionTestHelpers.AssertFullyConnected(GetAllOnlineCodexNodes());
PeerDownloadTestHelpers.AssertFullDownloadInterconnectivity(GetAllOnlineCodexNodes());
} }
} }
} }