diff --git a/backend/FwLite/FwLiteProjectSync.Tests/Fixtures/SyncFixture.cs b/backend/FwLite/FwLiteProjectSync.Tests/Fixtures/SyncFixture.cs index 7a1279ba19..72a5fb76dd 100644 --- a/backend/FwLite/FwLiteProjectSync.Tests/Fixtures/SyncFixture.cs +++ b/backend/FwLite/FwLiteProjectSync.Tests/Fixtures/SyncFixture.cs @@ -17,6 +17,7 @@ public class SyncFixture : IAsyncLifetime _services.ServiceProvider.GetRequiredService(); public IServiceProvider Services => _services.ServiceProvider; private readonly string _projectName; + private readonly string _projectFolder; private readonly IDisposable _cleanup; public static SyncFixture Create([CallerMemberName] string projectName = "", [CallerMemberName] string projectFolder = "") => new(projectName, projectFolder); @@ -24,6 +25,7 @@ public class SyncFixture : IAsyncLifetime private SyncFixture(string projectName, string projectFolder) { _projectName = projectName; + _projectFolder = projectFolder; var crdtServices = new ServiceCollection() .AddSyncServices(projectFolder); var rootServiceProvider = crdtServices.BuildServiceProvider(); @@ -31,7 +33,7 @@ private SyncFixture(string projectName, string projectFolder) _services = rootServiceProvider.CreateAsyncScope(); } - public SyncFixture(): this("sena-3_" + Guid.NewGuid().ToString("N"), "FwLiteSyncFixture") + public SyncFixture(): this("sena-3_" + Guid.NewGuid().ToString().Split("-")[0], "FwLiteSyncFixture" + Guid.NewGuid().ToString().Split("-")[0]) { } @@ -58,6 +60,9 @@ public async Task DisposeAsync() { await _services.DisposeAsync(); _cleanup.Dispose(); + + Microsoft.Data.Sqlite.SqliteConnection.ClearAllPools(); + Directory.Delete(_projectFolder, true); } public CrdtMiniLcmApi CrdtApi { get; set; } = null!;