Skip to content

Commit 341e466

Browse files
committed
fix: clear sqlite pools before test cleanup
1 parent 1be0ed4 commit 341e466

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

DotPilot.Tests/ChatSessions/Execution/AgentSessionServiceTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public sealed class AgentSessionServiceTests
1313
{
1414
private const int LegacyDefaultRole = 4;
1515
private const string LegacyEmptyCapabilitiesJson = "[]";
16-
private const int DeleteRetryCount = 20;
16+
private const int DeleteRetryCount = 40;
1717
private static readonly TimeSpan DeleteRetryDelay = TimeSpan.FromMilliseconds(250);
1818

1919
[Test]
@@ -650,6 +650,7 @@ private static async Task DeleteDirectoryWithRetryAsync(string path)
650650
{
651651
for (var attempt = 0; attempt < DeleteRetryCount; attempt++)
652652
{
653+
SqliteConnection.ClearAllPools();
653654
if (!Directory.Exists(path))
654655
{
655656
return;

DotPilot.Tests/ChatSessions/Persistence/AgentSessionPersistenceTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
using System.Text.Json.Serialization.Metadata;
33
using DotPilot.Core.ChatSessions;
44
using DotPilot.Core.ControlPlaneDomain;
5+
using Microsoft.Data.Sqlite;
56
using Microsoft.Extensions.AI;
67
using Microsoft.Extensions.DependencyInjection;
78

89
namespace DotPilot.Tests.ChatSessions;
910

1011
public sealed class AgentSessionPersistenceTests
1112
{
12-
private const int DeleteRetryCount = 20;
13+
private const int DeleteRetryCount = 40;
1314
private static readonly TimeSpan DeleteRetryDelay = TimeSpan.FromMilliseconds(250);
1415
private static readonly JsonSerializerOptions HistorySerializerOptions = new()
1516
{
@@ -158,6 +159,7 @@ private static async Task DeleteDirectoryAsync(string path)
158159
{
159160
for (var attempt = 0; attempt < DeleteRetryCount; attempt++)
160161
{
162+
SqliteConnection.ClearAllPools();
161163
if (!Directory.Exists(path))
162164
{
163165
return;

DotPilot.Tests/Workspace/Services/StartupWorkspaceHydrationTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
using DotPilot.Core.ChatSessions;
22
using DotPilot.Tests.Providers;
3+
using Microsoft.Data.Sqlite;
34
using Microsoft.Extensions.DependencyInjection;
45

56
namespace DotPilot.Tests.Workspace;
67

78
[NonParallelizable]
89
public sealed class StartupWorkspaceHydrationTests
910
{
10-
private const int DeleteRetryCount = 20;
11+
private const int DeleteRetryCount = 40;
1112
private static readonly TimeSpan DeleteRetryDelay = TimeSpan.FromMilliseconds(250);
1213

1314
[Test]
@@ -112,6 +113,7 @@ private static async Task DeleteDirectoryWithRetryAsync(string path)
112113
{
113114
for (var attempt = 0; attempt < DeleteRetryCount; attempt++)
114115
{
116+
SqliteConnection.ClearAllPools();
115117
if (!Directory.Exists(path))
116118
{
117119
return;

0 commit comments

Comments
 (0)