From c239d555dc938879aaffa3019c7b9ee5ea611cc5 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 9 Oct 2024 11:37:16 +0200 Subject: [PATCH] More reliable test --- Tests/CodexTests/BasicTests/OneClientTests.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Tests/CodexTests/BasicTests/OneClientTests.cs b/Tests/CodexTests/BasicTests/OneClientTests.cs index ef8c18b..27c855a 100644 --- a/Tests/CodexTests/BasicTests/OneClientTests.cs +++ b/Tests/CodexTests/BasicTests/OneClientTests.cs @@ -22,19 +22,16 @@ namespace CodexTests.BasicTests [Test] public void InterruptUploadTest() { - var tasks = new List>(); - for (var i = 0; i < 10; i++) - { - tasks.Add(Task.Run(() => RunInterruptUploadTest())); - } + var nodes = StartCodex(10); + + var tasks = nodes.Select(n => Task.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);