diff --git a/DistTestCore/Codex/CodexAccess.cs b/DistTestCore/Codex/CodexAccess.cs index 57f7689..cf6ac19 100644 --- a/DistTestCore/Codex/CodexAccess.cs +++ b/DistTestCore/Codex/CodexAccess.cs @@ -95,11 +95,10 @@ namespace DistTestCore.Codex private Http Http() { - CheckContainerCrashed(); - return new Http(log, timeSet, Address, baseUrl: "/api/codex/v1", Container.Name); + return new Http(log, timeSet, Address, baseUrl: "/api/codex/v1", CheckContainerCrashed, Container.Name); } - private void CheckContainerCrashed() + private void CheckContainerCrashed(HttpClient client) { if (hasContainerCrashed) throw new Exception("Container has crashed."); } diff --git a/DistTestCore/Helpers/FullConnectivityHelper.cs b/DistTestCore/Helpers/FullConnectivityHelper.cs index 228beeb..68dfdbb 100644 --- a/DistTestCore/Helpers/FullConnectivityHelper.cs +++ b/DistTestCore/Helpers/FullConnectivityHelper.cs @@ -56,7 +56,7 @@ namespace DistTestCore.Helpers private static void RetryWhilePairs(List pairs, Action action) { - var timeout = DateTime.UtcNow + TimeSpan.FromMinutes(5); + var timeout = DateTime.UtcNow + TimeSpan.FromMinutes(2); while (pairs.Any(p => p.Inconclusive) && timeout > DateTime.UtcNow) { action(); diff --git a/DistTestCore/Helpers/PeerDownloadTestHelpers.cs b/DistTestCore/Helpers/PeerDownloadTestHelpers.cs index 40024e1..cd12e2b 100644 --- a/DistTestCore/Helpers/PeerDownloadTestHelpers.cs +++ b/DistTestCore/Helpers/PeerDownloadTestHelpers.cs @@ -7,6 +7,7 @@ namespace DistTestCore.Helpers public class PeerDownloadTestHelpers : IFullConnectivityImplementation { private readonly FullConnectivityHelper helper; + private readonly BaseLog log; private readonly FileManager fileManager; private ByteSize testFileSize; @@ -14,6 +15,7 @@ namespace DistTestCore.Helpers { helper = new FullConnectivityHelper(log, this); testFileSize = 1.MB(); + this.log = log; this.fileManager = fileManager; } @@ -44,11 +46,11 @@ namespace DistTestCore.Helpers var expectedFile = GenerateTestFile(from.Node, to.Node); using var uploadStream = File.OpenRead(expectedFile.Filename); - var contentId = from.Node.UploadFile(uploadStream); + var contentId = Stopwatch.Measure(log, "Upload", () => from.Node.UploadFile(uploadStream)); try { - var downloadedFile = DownloadFile(to.Node, contentId, expectedFile.Label + "_downloaded"); + var downloadedFile = Stopwatch.Measure(log, "Download", () => DownloadFile(to.Node, contentId, expectedFile.Label + "_downloaded")); expectedFile.AssertIsEqual(downloadedFile); return PeerConnectionState.Connection; }