mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-01-02 13:33:07 +00:00
shuts down uploader client in repair test before host cycling starts
This commit is contained in:
parent
c4d4624d5e
commit
659cce1411
@ -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)
|
||||
{
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user