Dispose of semaphorse
MODIFY
WalletWasabi.Tests/UnitTests/EventSourcing/InMemoryEventRepositoryTests.cs
WalletWasabi.Tests/UnitTests/EventSourcing/InMemoryEventRepositoryTests.cs
@@ -10,7 +10,7 @@ using Xunit.Abstractions;
namespace WalletWasabi.Tests.UnitTests.EventSourcing
{
- public class InMemoryEventRepositoryTests
+ public class InMemoryEventRepositoryTests : IDisposable
{
private const string TestRoundAggregate = "TestRoundAggregate";
private readonly TimeSpan _semaphoreWaitTimeout = TimeSpan.FromSeconds(1);
@@ -429,5 +429,10 @@ namespace WalletWasabi.Tests.UnitTests.EventSourcing
Assert.True(result.Count <= limit);
Assert.True(result.All(a => afterAggregateId.CompareTo(a) <= 0));
}
+
+ public void Dispose()
+ {
+ TestEventRepository.Dispose();
+ }
}
}

MODIFY
WalletWasabi.Tests/UnitTests/EventSourcing/TestDomain/TestInMemoryEventRepository.cs
WalletWasabi.Tests/UnitTests/EventSourcing/TestDomain/TestInMemoryEventRepository.cs
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Threading;
-using System.Threading.Tasks;
using WalletWasabi.EventSourcing;
using Xunit.Abstractions;
namespace WalletWasabi.Tests.UnitTests.EventSourcing.TestDomain
{
- public class TestInMemoryEventRepository : InMemoryEventRepository
+ public class TestInMemoryEventRepository : InMemoryEventRepository, IDisposable
{
public TestInMemoryEventRepository(ITestOutputHelper output)
{
@@ -49,5 +44,12 @@ namespace WalletWasabi.Tests.UnitTests.EventSourcing.TestDomain
AppendedSemaphore.Release();
AppendedCallback?.Invoke();
}
+
+ public void Dispose()
+ {
+ ValidatedSemaphore.Dispose();
+ ConflictedSemaphore.Dispose();
+ AppendedSemaphore.Dispose();
+ }
}
}

Dispose of semaphorse