From d498fbbb68b652fbc21707e18f59e6232bcc2931 Mon Sep 17 00:00:00 2001 From: benbierens Date: Tue, 5 Sep 2023 13:29:31 +0200 Subject: [PATCH] Sets up continuous test for fetch connectivity. --- ContinuousTests/Tests/FetchTest.cs | 18 ++++++++++++++++++ DistTestCore/Helpers/PeerFetchTestHelpers.cs | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 ContinuousTests/Tests/FetchTest.cs diff --git a/ContinuousTests/Tests/FetchTest.cs b/ContinuousTests/Tests/FetchTest.cs new file mode 100644 index 0000000..38d3aae --- /dev/null +++ b/ContinuousTests/Tests/FetchTest.cs @@ -0,0 +1,18 @@ +using DistTestCore.Helpers; + +namespace ContinuousTests.Tests +{ + public class FetchTest : ContinuousTest + { + public override int RequiredNumberOfNodes => -1; + public override TimeSpan RunTestEvery => TimeSpan.FromMinutes(2); + public override TestFailMode TestFailMode => TestFailMode.AlwaysRunAllMoments; + + [TestMoment(t: 0)] + public void CheckConnectivity() + { + var checker = new PeerFetchTestHelpers(Log, FileManager); + checker.AssertFullFetchInterconnectivity(Nodes); + } + } +} diff --git a/DistTestCore/Helpers/PeerFetchTestHelpers.cs b/DistTestCore/Helpers/PeerFetchTestHelpers.cs index da260a2..c119db0 100644 --- a/DistTestCore/Helpers/PeerFetchTestHelpers.cs +++ b/DistTestCore/Helpers/PeerFetchTestHelpers.cs @@ -9,11 +9,11 @@ namespace DistTestCore.Helpers { private readonly FullConnectivityHelper helper; private readonly BaseLog log; - private readonly FileManager fileManager; + private readonly IFileManager fileManager; private readonly ByteSize testFileSize; private readonly int expectedNumberOfBlocks; - public PeerFetchTestHelpers(BaseLog log, FileManager fileManager) + public PeerFetchTestHelpers(BaseLog log, IFileManager fileManager) { helper = new FullConnectivityHelper(log, this); testFileSize = 10.MB();