shuts down uploader client in repair test before host cycling starts

This commit is contained in:
Ben 2025-08-12 15:23:12 +02:00
parent c4d4624d5e
commit 659cce1411
No known key found for this signature in database
GPG Key ID: 0F16E812E736C24B
2 changed files with 14 additions and 4 deletions

View File

@ -33,8 +33,10 @@ namespace CodexReleaseTests.MarketTests
[Combinatorial]
public void RollingRepairSingleFailure(
[Rerun] int rerun,
[Values(5)] int numFailures)
[Values(10)] int numFailures)
{
Assert.That(numFailures, Is.GreaterThan(NumberOfHosts));
var hosts = StartHosts().ToList();
var client = StartClients().Single();
StartValidator();
@ -43,9 +45,12 @@ namespace CodexReleaseTests.MarketTests
contract.WaitForStorageContractStarted();
// All slots are filled.
client.Stop(waitTillStopped: true);
for (var i = 0; i < numFailures; i++)
{
Log($"Failure step: {i}");
Log($"Running hosts: [{string.Join(", ", hosts.Select(h => h.GetName()))}]");
// Start a new host. Add it to the back of the list:
hosts.Add(StartOneHost());
@ -66,10 +71,11 @@ namespace CodexReleaseTests.MarketTests
private void WaitForSlotFreedEvent(IStoragePurchaseContract contract, ulong slotIndex)
{
Log(nameof(WaitForSlotFreedEvent));
var start = DateTime.UtcNow;
var timeout = CalculateContractFailTimespan();
Log($"{nameof(WaitForSlotFreedEvent)} {Time.FormatDuration(timeout)} requestId: '{contract.PurchaseId.ToLowerInvariant()}' slotIndex: {slotIndex}");
while (DateTime.UtcNow < start + timeout)
{
var events = GetContracts().GetEvents(GetTestRunTimeRange());
@ -78,7 +84,10 @@ namespace CodexReleaseTests.MarketTests
foreach (var free in slotsFreed)
{
if (free.RequestId.ToHex().ToLowerInvariant() == contract.PurchaseId.ToLowerInvariant())
var freedId = free.RequestId.ToHex().ToLowerInvariant();
Log($"Free for requestId '{freedId}' slotIndex: {free.SlotIndex}");
if (freedId == contract.PurchaseId.ToLowerInvariant())
{
if (free.SlotIndex == slotIndex)
{

View File

@ -1,6 +1,7 @@
using CodexContractsPlugin;
using CodexContractsPlugin.ChainMonitor;
using Logging;
using Utils;
namespace CodexReleaseTests.Utils
{
@ -44,7 +45,7 @@ namespace CodexReleaseTests.Utils
var state = new ChainState(log, contracts, new DoNothingThrowingChainEventHandler(), startUtc, doProofPeriodMonitoring: true);
Thread.Sleep(updateInterval);
log.Log("Chain monitoring started");
log.Log($"Chain monitoring started. Update interval: {Time.FormatDuration(updateInterval)}");
while (!cts.IsCancellationRequested)
{
try