Commit 37cd3cde authored by Andrei-Flavius Ivan's avatar Andrei-Flavius Ivan
Browse files

Fixes for test issues

parent 013245a8
......@@ -2,7 +2,7 @@
<PropertyGroup>
<Description>Contains productivity tools for ASPNET Core. These include filtering &amp; paging contexts, base CRUD controller with Automapper support and Swagger context</Description>
<VersionPrefix>1.7.3</VersionPrefix>
<VersionPrefix>1.8.0</VersionPrefix>
<Authors>Andrei-Flavius Ivan</Authors>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>Mindgaze.AspNetCore</AssemblyName>
......
......@@ -104,9 +104,10 @@ namespace Mindgaze.AspNetCore.Testing
Host = hostBuilder.Build();
DbContext = GetService<TDbContext>();
DbContext.Database.Migrate();
// Client = Server.CreateClient();
// Make sure the db is clean
DbContext.Database.EnsureDeleted();
DbContext.Database.Migrate();
Task.Run(async () =>
{
......@@ -166,29 +167,22 @@ namespace Mindgaze.AspNetCore.Testing
public void Dispose()
{
int i = 0;
while (i < 50)
try
{
try
{
Client.CancelPendingRequests();
Client.Dispose();
DbContext.Database.EnsureDeleted();
GC.Collect();
// CancelToken.WaitHandle.Dispose();
Host.StopAsync();
Host.Dispose();
Console.WriteLine("Disposed of resources");
break;
}
catch
{
i++;
Thread.Sleep(1000);
}
Client.CancelPendingRequests();
Client.Dispose();
GC.Collect();
DbContext.Database.EnsureDeleted();
Host.StopAsync().Wait();
Host.Dispose();
Console.WriteLine("Disposed of resources");
}
catch (Exception ex)
{
File.AppendAllText("/home/afivan/Documents/asperrors.txt", ex.Message);
File.AppendAllText("/home/afivan/Documents/asperrors.txt", ex.StackTrace);
File.AppendAllText("/home/afivan/Documents/asperrors.txt", "\n\n\n");
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment