Test clean-up on Windows no longer fails on SQLite files the connection pool still holds #9

Closed
opened 2026-10-31 12:41:48 -04:00 by claude · 1 comment
Owner
  • Draft: REL-3
  • Priority: medium (23 of the 41 Windows failures)
  • Agent: coder
  • Depends on: none
  • Decisions: none

Why

On Windows, Directory.Delete throws IOException: The process cannot access the file 'test.sqlite3' because it is being used by another process: Microsoft.Data.Sqlite pools the
connection, which keeps the file open. Linux allows deleting an open file, so it passes there.

What changes

  • src/dotnet/tests/Ninlil.Dns.Server.Backup.Tests/SystemBackupServiceArchiveValidationTests.cs:93
    and SystemBackupServiceAtomicRestoreTests (20 tests): call SqliteConnection.ClearAllPools()
    (or clear the pool of the test's connection string) before deleting the folder.
  • src/dotnet/tests/Ninlil.Web.Tests/StorageHealthCheckTests.cs (the SQLite case) and
    StorageReplicaHealthCheckTests.cs (2 tests, file health.sqlite3): same.
  • Look for other test classes that delete a SQLite file in Dispose/DisposeAsync and apply the
    same rule (grep Directory.Delete and .sqlite3 under src/dotnet/tests).

Acceptance

  • The 23 tests pass natively on Windows (Lofnheim, from a git bundle); quote the summary.
  • Unchanged on Linux: dotnet test src/dotnet/tests/Ninlil.Dns.Server.Backup.Tests and
    dotnet test src/dotnet/tests/Ninlil.Web.Tests --filter "FullyQualifiedName~StorageHealthCheckTests|FullyQualifiedName~StorageReplicaHealthCheckTests".
  • Clean-up leaves no ninlil-* temp folder behind on Windows.

Source

RP-4 report finding 3 ("20 Backup tests", "StorageHealthCheckTests Sqlite and 2
StorageReplicaHealthCheckTests"); release-prep.md:159.

- **Draft:** REL-3 - **Priority:** medium (23 of the 41 Windows failures) - **Agent:** coder - **Depends on:** none - **Decisions:** none ### Why On Windows, `Directory.Delete` throws `IOException: The process cannot access the file 'test.sqlite3' because it is being used by another process`: Microsoft.Data.Sqlite pools the connection, which keeps the file open. Linux allows deleting an open file, so it passes there. ### What changes - `src/dotnet/tests/Ninlil.Dns.Server.Backup.Tests/SystemBackupServiceArchiveValidationTests.cs:93` and `SystemBackupServiceAtomicRestoreTests` (20 tests): call `SqliteConnection.ClearAllPools()` (or clear the pool of the test's connection string) before deleting the folder. - `src/dotnet/tests/Ninlil.Web.Tests/StorageHealthCheckTests.cs` (the SQLite case) and `StorageReplicaHealthCheckTests.cs` (2 tests, file `health.sqlite3`): same. - Look for other test classes that delete a SQLite file in `Dispose`/`DisposeAsync` and apply the same rule (grep `Directory.Delete` and `.sqlite3` under `src/dotnet/tests`). ### Acceptance - [ ] The 23 tests pass natively on Windows (Lofnheim, from a git bundle); quote the summary. - [ ] Unchanged on Linux: `dotnet test src/dotnet/tests/Ninlil.Dns.Server.Backup.Tests` and `dotnet test src/dotnet/tests/Ninlil.Web.Tests --filter "FullyQualifiedName~StorageHealthCheckTests|FullyQualifiedName~StorageReplicaHealthCheckTests"`. - [ ] Clean-up leaves no `ninlil-*` temp folder behind on Windows. ### Source RP-4 report finding 3 ("20 Backup tests", "StorageHealthCheckTests Sqlite and 2 StorageReplicaHealthCheckTests"); `release-prep.md:159`.
Author
Owner

Done on feature/8-windows-test-suite (e78555de): Windows Backup.Tests 42/65 → 65/65, storage health 3/9 → 9/9; whole solution green on Linux. Closes when the epic branch merges into develop.

Done on `feature/8-windows-test-suite` (e78555de): Windows Backup.Tests 42/65 → 65/65, storage health 3/9 → 9/9; whole solution green on Linux. Closes when the epic branch merges into develop.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
lantea-one/ninlil#9
No description provided.