diff --git a/Tests/BasicTests/DownloadTests.cs b/LongTests/BasicTests/DownloadTests.cs similarity index 95% rename from Tests/BasicTests/DownloadTests.cs rename to LongTests/BasicTests/DownloadTests.cs index 36a635f..5034462 100644 --- a/Tests/BasicTests/DownloadTests.cs +++ b/LongTests/BasicTests/DownloadTests.cs @@ -1,7 +1,7 @@ using DistTestCore; using NUnit.Framework; -namespace Tests.ParallelTests +namespace TestsLong.BasicTests { [TestFixture] public class DownloadTests : DistTest @@ -23,7 +23,7 @@ namespace Tests.ParallelTests var testFile = GenerateTestFile(filesizeMb.MB()); var contentId = host.UploadFile(testFile); var list = new List>(); - + foreach (var node in group) { list.Add(Task.Run(() => { return node.DownloadContent(contentId); })); diff --git a/Tests/BasicTests/UploadTests.cs b/LongTests/BasicTests/UploadTests.cs similarity index 97% rename from Tests/BasicTests/UploadTests.cs rename to LongTests/BasicTests/UploadTests.cs index ea3b41c..ab005fe 100644 --- a/Tests/BasicTests/UploadTests.cs +++ b/LongTests/BasicTests/UploadTests.cs @@ -1,7 +1,7 @@ using DistTestCore; using NUnit.Framework; -namespace Tests.ParallelTests +namespace TestsLong.BasicTests { [TestFixture] public class UploadTests : DistTest diff --git a/Tests/DurabilityTests/DurabilityTests.cs b/Tests/DurabilityTests/DurabilityTests.cs deleted file mode 100644 index 1267400..0000000 --- a/Tests/DurabilityTests/DurabilityTests.cs +++ /dev/null @@ -1,66 +0,0 @@ -using DistTestCore; -using DistTestCore.Codex; -using NUnit.Framework; -using Utils; - -namespace Tests.DurabilityTests -{ - [TestFixture] - public class DurabilityTests : DistTest - { - [Test] - public void BootstrapNodeDisappearsTest() - { - var bootstrapNode = SetupCodexBootstrapNode(); - var group = SetupCodexNodes(2, s => s.WithBootstrapNode(bootstrapNode)); - var primary = group[0]; - var secondary = group[1]; - - // There is 1 minute of time f or the nodes to connect to each other. - // (Should be easy, they're in the same pod.) - Time.Sleep(TimeSpan.FromMinutes(6)); - bootstrapNode.BringOffline(); - - var file = GenerateTestFile(10.MB()); - var contentId = primary.UploadFile(file); - var downloadedFile = secondary.DownloadContent(contentId); - - file.AssertIsEqual(downloadedFile); - } - - [Test] - public void DataRetentionTest() - { - var bootstrapNode = SetupCodexBootstrapNode(); - - var startGroup = SetupCodexNodes(2, s => s.WithBootstrapNode(bootstrapNode)); - var finishGroup = SetupCodexNodes(10, s => s.WithBootstrapNode(bootstrapNode)); - - var file = GenerateTestFile(10.MB()); - - // Both nodes in the start group have the file. - var content = startGroup[0].UploadFile(file); - DownloadAndAssert(content, file, startGroup[1]); - - // Three nodes of the finish group have the file. - DownloadAndAssert(content, file, finishGroup[0]); - DownloadAndAssert(content, file, finishGroup[1]); - DownloadAndAssert(content, file, finishGroup[2]); - - // The start group goes away. - startGroup.BringOffline(); - - // All nodes in the finish group can access the file. - foreach (var node in finishGroup) - { - DownloadAndAssert(content, file, node); - } - } - - private void DownloadAndAssert(ContentId content, TestFile file, IOnlineCodexNode onlineCodexNode) - { - var downloaded = onlineCodexNode.DownloadContent(content); - file.AssertIsEqual(downloaded); - } - } -} diff --git a/Utils/Time.cs b/Utils/Time.cs index 6ae2640..5d6979b 100644 --- a/Utils/Time.cs +++ b/Utils/Time.cs @@ -41,22 +41,22 @@ public static void Retry(Action action, string description) { - Retry(action, TimeSpan.FromMinutes(1), description); + Retry(action, TimeSpan.FromMinutes(2), description); } public static T Retry(Func action, string description) { - return Retry(action, TimeSpan.FromMinutes(1), description); + return Retry(action, TimeSpan.FromMinutes(2), description); } public static void Retry(Action action, TimeSpan timeout, string description) { - Retry(action, timeout, TimeSpan.FromSeconds(1), description); + Retry(action, timeout, TimeSpan.FromSeconds(2), description); } public static T Retry(Func action, TimeSpan timeout, string description) { - return Retry(action, timeout, TimeSpan.FromSeconds(1), description); + return Retry(action, timeout, TimeSpan.FromSeconds(2), description); } public static void Retry(Action action, TimeSpan timeout, TimeSpan retryTime, string description)