This is working

This commit is contained in:
Ben 2025-06-04 15:51:01 +02:00
parent 64d271c809
commit 44d14e589a
No known key found for this signature in database
GPG Key ID: 0F16E812E736C24B
4 changed files with 22 additions and 6 deletions

View File

@ -146,7 +146,6 @@ namespace CodexContractsPlugin
public void WaitUntilNextPeriod()
{
log.Log("Waiting until next proof period...");
var now = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
var periodSeconds = (int)Deployment.Config.Proofs.Period;
var secondsLeft = now % periodSeconds;

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@
{
public class CodexDockerImage
{
private const string DefaultDockerImage = "codexstorage/nim-codex:0.2.3-dist-tests";
private const string DefaultDockerImage = "codexstorage/nim-codex:sha-2e1306a-dist-tests";
public static string Override { get; set; } = string.Empty;

View File

@ -8,11 +8,16 @@ namespace CodexReleaseTests.MarketTests
public class FailTest : MarketplaceAutoBootstrapDistTest
{
protected override int NumberOfHosts => 4;
private readonly int SlotTolerance;
protected override int NumberOfClients => 1;
protected override ByteSize HostAvailabilitySize => 1.GB();
protected override TimeSpan HostAvailabilityMaxDuration => TimeSpan.FromDays(1.0);
[Ignore("Slots are never freed because proofs are never marked as missing. Issue: https://github.com/codex-storage/nim-codex/issues/1153")]
public FailTest()
{
SlotTolerance = NumberOfHosts / 2;
}
[Test]
[Combinatorial]
public void Fail(
@ -50,7 +55,8 @@ namespace CodexReleaseTests.MarketTests
{
var events = GetContracts().GetEvents(GetTestRunTimeRange());
var slotFreed = events.GetSlotFreedEvents();
if (slotFreed.Length == NumberOfHosts)
Log($"SlotFreed events: {slotFreed.Length} - Expected: {SlotTolerance}");
if (slotFreed.Length > SlotTolerance)
{
Log($"{nameof(WaitForSlotFreedEvents)} took {Time.FormatDuration(DateTime.UtcNow - start)}");
return;
@ -68,7 +74,7 @@ namespace CodexReleaseTests.MarketTests
Duration = HostAvailabilityMaxDuration / 2,
Expiry = TimeSpan.FromMinutes(5.0),
MinRequiredNumberOfNodes = (uint)NumberOfHosts,
NodeFailureTolerance = (uint)(NumberOfHosts / 2),
NodeFailureTolerance = (uint)SlotTolerance,
PricePerBytePerSecond = 100.TstWei(),
ProofProbability = 1, // Require a proof every period
CollateralPerByte = 1.TstWei()