cs-codex-dist-tests/Tests/CodexTests/DownloadConnectivityTests/SwarmTests.cs

26 lines
708 B
C#
Raw Normal View History

2024-10-11 08:30:07 +00:00
using NUnit.Framework;
using Utils;
namespace CodexTests.DownloadConnectivityTests
{
[TestFixture]
public class SwarmTests : AutoBootstrapDistTest
{
[Test]
2024-10-11 09:20:59 +00:00
[Combinatorial]
2024-10-11 08:30:07 +00:00
[CreateTranscript("swarm_retransmit")]
2024-10-11 09:20:59 +00:00
public void DetectBlockRetransmits(
[Values(1, 5, 10, 20)] int fileSize,
[Values(3, 5, 10, 20)] int numNodes
)
2024-10-11 08:30:07 +00:00
{
2024-10-11 09:20:59 +00:00
var nodes = StartCodex(numNodes);
var file = GenerateTestFile(fileSize.MB());
2024-10-11 08:30:07 +00:00
var cid = nodes[0].UploadFile(file);
var tasks = nodes.Select(n => Task.Run(() => n.DownloadContent(cid))).ToArray();
Task.WaitAll(tasks);
}
}
}