From 8c85cd22bb82d9c57369a8600290a2276acb5b93 Mon Sep 17 00:00:00 2001 From: benbierens Date: Mon, 29 May 2023 09:25:03 +0200 Subject: [PATCH] Adds clear logging for peer helper invocations. --- DistTestCore/Helpers/PeerConnectionTestHelpers.cs | 2 ++ DistTestCore/Helpers/PeerDownloadTestHelpers.cs | 3 +++ Tests/PeerDiscoveryTests/LayeredDiscoveryTests.cs | 1 + Tests/PeerDiscoveryTests/PeerDiscoveryTests.cs | 1 + 4 files changed, 7 insertions(+) diff --git a/DistTestCore/Helpers/PeerConnectionTestHelpers.cs b/DistTestCore/Helpers/PeerConnectionTestHelpers.cs index 1f3422a..9d6203f 100644 --- a/DistTestCore/Helpers/PeerConnectionTestHelpers.cs +++ b/DistTestCore/Helpers/PeerConnectionTestHelpers.cs @@ -21,6 +21,7 @@ namespace DistTestCore.Helpers 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 pairs = CreatePairs(entries); @@ -33,6 +34,7 @@ namespace DistTestCore.Helpers { 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 pairs, Action action) diff --git a/DistTestCore/Helpers/PeerDownloadTestHelpers.cs b/DistTestCore/Helpers/PeerDownloadTestHelpers.cs index 77e8901..d3280e9 100644 --- a/DistTestCore/Helpers/PeerDownloadTestHelpers.cs +++ b/DistTestCore/Helpers/PeerDownloadTestHelpers.cs @@ -16,6 +16,7 @@ public void AssertFullDownloadInterconnectivity(IEnumerable nodes, ByteSize testFileSize) { + test.Debug($"Asserting full download interconnectivity for nodes: '{string.Join(",", nodes.Select(n => n.GetName()))}'..."); foreach (var node in nodes) { var uploader = node; @@ -26,6 +27,8 @@ 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) diff --git a/Tests/PeerDiscoveryTests/LayeredDiscoveryTests.cs b/Tests/PeerDiscoveryTests/LayeredDiscoveryTests.cs index ad04144..8e6dbf4 100644 --- a/Tests/PeerDiscoveryTests/LayeredDiscoveryTests.cs +++ b/Tests/PeerDiscoveryTests/LayeredDiscoveryTests.cs @@ -56,6 +56,7 @@ namespace Tests.PeerDiscoveryTests private void AssertAllNodesConnected() { PeerConnectionTestHelpers.AssertFullyConnected(GetAllOnlineCodexNodes()); + PeerDownloadTestHelpers.AssertFullDownloadInterconnectivity(GetAllOnlineCodexNodes()); } } } diff --git a/Tests/PeerDiscoveryTests/PeerDiscoveryTests.cs b/Tests/PeerDiscoveryTests/PeerDiscoveryTests.cs index 7797764..c5a85a4 100644 --- a/Tests/PeerDiscoveryTests/PeerDiscoveryTests.cs +++ b/Tests/PeerDiscoveryTests/PeerDiscoveryTests.cs @@ -57,6 +57,7 @@ namespace Tests.PeerDiscoveryTests private void AssertAllNodesConnected() { PeerConnectionTestHelpers.AssertFullyConnected(GetAllOnlineCodexNodes()); + PeerDownloadTestHelpers.AssertFullDownloadInterconnectivity(GetAllOnlineCodexNodes()); } } }