More reliable test

This commit is contained in:
Ben 2024-10-09 11:37:16 +02:00
parent 2e9d7641a3
commit c239d555dc
No known key found for this signature in database
GPG Key ID: 0F16E812E736C24B
1 changed files with 4 additions and 7 deletions

View File

@ -22,19 +22,16 @@ namespace CodexTests.BasicTests
[Test]
public void InterruptUploadTest()
{
var tasks = new List<Task<bool>>();
for (var i = 0; i < 10; i++)
{
tasks.Add(Task<bool>.Run(() => RunInterruptUploadTest()));
}
var nodes = StartCodex(10);
var tasks = nodes.Select(n => Task<bool>.Run(() => RunInterruptUploadTest(n)));
Task.WaitAll(tasks.ToArray());
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 process = StartCurlUploadProcess(node, file);