1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-20 21:54:58 -04:00

Fixed several tests and test infrastructure issues

This commit is contained in:
Taloth Saldono
2019-08-16 22:04:34 +02:00
parent ef6a648189
commit de31dfb11e
10 changed files with 120 additions and 58 deletions
+8 -14
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Data.SQLite;
using System.IO;
using System.Linq;
using FluentMigrator.Runner;
@@ -115,21 +116,14 @@ namespace NzbDrone.Core.Test.Framework
[TearDown]
public void TearDown()
{
if (TestFolderInfo != null && Directory.Exists(TestFolderInfo.AppDataFolder))
// Make sure there are no lingering connections. (When this happens it means we haven't disposed something properly)
GC.Collect();
GC.WaitForPendingFinalizers();
SQLiteConnection.ClearAllPools();
if (TestFolderInfo != null)
{
var files = Directory.GetFiles(TestFolderInfo.AppDataFolder);
foreach (var file in files)
{
try
{
File.Delete(file);
}
catch (Exception)
{
}
}
DeleteTempFolder(TestFolderInfo.AppDataFolder);
}
}
}