tests fixes

This commit is contained in:
master
2026-01-27 08:23:42 +02:00
parent c305d05d32
commit 82caceba56
58 changed files with 651 additions and 312 deletions

View File

@@ -24,8 +24,7 @@ public class ControlPlaneOutageTests : IClassFixture<ControlPlaneClusterFixture>
public ControlPlaneOutageTests(ControlPlaneClusterFixture fixture)
{
_fixture = fixture;
_fixture.FailureInjector.RecoverAll();
_fixture.ClearEventLog();
_fixture.ResetAll();
}
#region Authority Outage Tests

View File

@@ -365,6 +365,42 @@ public sealed class ControlPlaneClusterFixture : IAsyncLifetime
while (_eventLog.TryDequeue(out _)) { }
}
/// <summary>
/// Clears the pending jobs queue.
/// </summary>
public void ClearPendingJobs()
{
while (_pendingJobs.TryDequeue(out _)) { }
}
/// <summary>
/// Clears the token cache.
/// </summary>
public void ClearTokenCache()
{
_tokenCache.Clear();
}
/// <summary>
/// Clears the data store.
/// </summary>
public void ClearDataStore()
{
_dataStore.Clear();
}
/// <summary>
/// Resets all state for test isolation.
/// </summary>
public void ResetAll()
{
ClearEventLog();
ClearPendingJobs();
ClearTokenCache();
ClearDataStore();
_failureInjector.RecoverAll();
}
private void LogEvent(string service, string eventType, string details)
{
var seq = Interlocked.Increment(ref _eventSequence);

View File

@@ -25,8 +25,7 @@ public class PartialOutageTests : IClassFixture<ControlPlaneClusterFixture>
public PartialOutageTests(ControlPlaneClusterFixture fixture)
{
_fixture = fixture;
_fixture.FailureInjector.RecoverAll();
_fixture.ClearEventLog();
_fixture.ResetAll();
}
#region Partial Failure Rate Tests