More reliable test
This commit is contained in:
parent
2e9d7641a3
commit
c239d555dc
|
@ -22,19 +22,16 @@ namespace CodexTests.BasicTests
|
||||||
[Test]
|
[Test]
|
||||||
public void InterruptUploadTest()
|
public void InterruptUploadTest()
|
||||||
{
|
{
|
||||||
var tasks = new List<Task<bool>>();
|
var nodes = StartCodex(10);
|
||||||
for (var i = 0; i < 10; i++)
|
|
||||||
{
|
var tasks = nodes.Select(n => Task<bool>.Run(() => RunInterruptUploadTest(n)));
|
||||||
tasks.Add(Task<bool>.Run(() => RunInterruptUploadTest()));
|
|
||||||
}
|
|
||||||
Task.WaitAll(tasks.ToArray());
|
Task.WaitAll(tasks.ToArray());
|
||||||
|
|
||||||
Assert.That(tasks.Select(t => t.Result).All(r => r == true));
|
Assert.That(tasks.Select(t => t.Result).All(r => r == true));
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool RunInterruptUploadTest()
|
private bool RunInterruptUploadTest(ICodexNode node)
|
||||||
{
|
{
|
||||||
var node = StartCodex();
|
|
||||||
var file = GenerateTestFile(300.MB());
|
var file = GenerateTestFile(300.MB());
|
||||||
|
|
||||||
var process = StartCurlUploadProcess(node, file);
|
var process = StartCurlUploadProcess(node, file);
|
||||||
|
|
Loading…
Reference in New Issue