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] [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);