Improved rerun that support parallelism. Disable fail and repair tests until fixed/implemented.

This commit is contained in:
ThatBen 2025-05-30 09:57:21 +02:00
parent a8c094e735
commit d3642ffb4e
No known key found for this signature in database
GPG Key ID: 62C543548433D43E
5 changed files with 23 additions and 13 deletions

View File

@ -11,10 +11,13 @@ namespace CodexReleaseTests.MarketTests
protected override int NumberOfClients => 1;
protected override ByteSize HostAvailabilitySize => 1.GB();
protected override TimeSpan HostAvailabilityMaxDuration => TimeSpan.FromDays(1.0);
private readonly TestToken pricePerBytePerSecond = 10.TstWei();
[Ignore("Slots are never freed because proofs are never marked as missing. Issue: https://github.com/codex-storage/nim-codex/issues/1153")]
[Test]
public void Fail()
[Combinatorial]
public void Fail(
[Values([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16])] int rerun
)
{
var hosts = StartHosts();
var client = StartClients().Single();
@ -37,11 +40,11 @@ namespace CodexReleaseTests.MarketTests
private void WaitForSlotFreedEvents()
{
Log(nameof(WaitForSlotFreedEvents));
var start = DateTime.UtcNow;
var timeout = CalculateContractFailTimespan();
Log($"{nameof(WaitForSlotFreedEvents)} timeout: {Time.FormatDuration(timeout)}");
while (DateTime.UtcNow < start + timeout)
{
var events = GetContracts().GetEvents(GetTestRunTimeRange());
@ -61,13 +64,13 @@ namespace CodexReleaseTests.MarketTests
var cid = client.UploadFile(GenerateTestFile(5.MB()));
return client.Marketplace.RequestStorage(new StoragePurchaseRequest(cid)
{
Duration = TimeSpan.FromHours(1.0),
Expiry = TimeSpan.FromHours(0.2),
Duration = HostAvailabilityMaxDuration / 2,
Expiry = TimeSpan.FromMinutes(5.0),
MinRequiredNumberOfNodes = (uint)NumberOfHosts,
NodeFailureTolerance = (uint)(NumberOfHosts / 2),
PricePerBytePerSecond = pricePerBytePerSecond,
PricePerBytePerSecond = 100.TstWei(),
ProofProbability = 1, // Require a proof every period
CollateralPerByte = 1.Tst()
CollateralPerByte = 1.TstWei()
});
}
}

View File

@ -28,8 +28,10 @@ namespace CodexReleaseTests.MarketTests
protected override TimeSpan HostAvailabilityMaxDuration => Get8TimesConfiguredPeriodDuration() * 12;
[Test]
[Repeat(16)]
public void Finish()
[Combinatorial]
public void Finish(
[Values([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16])] int rerun
)
{
var hosts = StartHosts();
var client = StartClients().Single();

View File

@ -42,10 +42,12 @@ namespace CodexReleaseTests.MarketTests
#endregion
[Ignore("Test is ready. Waiting for repair implementation.")]
[Ignore("Test is ready. Waiting for repair implementation. " +
"Slots are never freed because proofs are never marked as missing. Issue: https://github.com/codex-storage/nim-codex/issues/1153")]
[Test]
[Combinatorial]
public void RollingRepairSingleFailure(
[Values([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16])] int rerun,
[Values(10)] int numFailures)
{
var hosts = StartHosts().ToList();

View File

@ -17,8 +17,10 @@ namespace CodexReleaseTests.MarketTests
protected override TimeSpan HostAvailabilityMaxDuration => Get8TimesConfiguredPeriodDuration() * 12;
[Test]
[Repeat(16)]
public void Start()
[Combinatorial]
public void Start(
[Values([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16])] int rerun
)
{
var hosts = StartHosts();
var client = StartClients().Single();

View File

@ -44,6 +44,7 @@ namespace CodexReleaseTests.Utils
var state = new ChainState(log, contracts, new DoNothingChainEventHandler(), startUtc, doProofPeriodMonitoring: true);
Thread.Sleep(updateInterval);
log.Log("Chain monitoring started");
while (!cts.IsCancellationRequested)
{
try