tests fixes
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user