8000 Address PR review feedback: Remove unnecessary pool clearing and make… · dotnet/efcore@eb2f7b1 · GitHub
[go: up one dir, main page]

Skip to content

Commit eb2f7b1

Browse files
Copilotcincuranet
andcommitted
Address PR review feedback: Remove unnecessary pool clearing and make cross-platform file handle leak test
Co-authored-by: cincuranet <4540597+cincuranet@users.noreply.github.com>
1 parent bbf53e5 commit eb2f7b1

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

test/Microsoft.Data.Sqlite.Tests/SqliteConnectionTest.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,18 +1315,13 @@ public void Open_releases_handle_when_constructor_fails()
13151315

13161316
Assert.Equal(ConnectionState.Closed, connection.State);
13171317

1318-
// Clear any pools that might hold connections
1319-
SqliteConnection.ClearPool(connection);
1320-
1321-
// The file should be movable/deletable now (indicating handle was released)
1322-
// If there's a file handle leak, this will fail on Windows
1323-
var tempPath = dbPath + ".moved";
1324-
File.Move(dbPath, tempPath);
1325-
File.Delete(tempPath);
1318+
// The file should be deletable now (indicating handle was released)
1319+
// If there's a file handle leak, this will fail
1320+
File.Delete(dbPath);
13261321
}
13271322
finally
13281323
{
1329-
// Clean up
1324+
// Clean up - file may already be deleted by the test
13301325
if (File.Exists(dbPath))
13311326
{
13321327
File.Delete(dbPath);
@@ -1355,9 +1350,6 @@ public void Open_releases_handle_when_opening_invalid_file()
13551350
// Should be some kind of error - we don't care about the specific code
13561351
Assert.True(ex.SqliteErrorCode != 0);
13571352
Assert.Equal(ConnectionState.Closed, connection.State);
1358-
1359-
// Clear any pools that might hold connections
1360-
SqliteConnection.ClearPool(connection);
13611353
}
13621354
finally
13631355
{

0 commit comments

Comments
 (0)
0