Increase retry timeout
This commit is contained in:
parent
61d2185bb6
commit
9747846787
|
@ -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<Task<TestFile?>>();
|
||||
|
||||
|
||||
foreach (var node in group)
|
||||
{
|
||||
list.Add(Task.Run(() => { return node.DownloadContent(contentId); }));
|
|
@ -1,7 +1,7 @@
|
|||
using DistTestCore;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Tests.ParallelTests
|
||||
namespace TestsLong.BasicTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class UploadTests : DistTest
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<T>(Func<T> 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<T>(Func<T> 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)
|
||||
|
|
Loading…
Reference in New Issue