Skip to content

Commit

Permalink
fix(Reference): remove NRE on shutdown and EX chomping
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaCuneo committed Oct 4, 2024
1 parent c96602f commit 1f2d1b5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Ark.Reference.Core.Tests.Init
[Binding]
class DatabaseUtils
{
public const string DatabaseConnectionString = @"Data Source=127.0.0.1;Encrypt=True;TrustServerCertificate=True;User Id=sa;Password=ArkSpecFlow123Stella!;";
public const string DatabaseConnectionString = @"Data Source=127.0.0.1;User Id=sa;Password=ArkSpecFlow123Stella!;Pooling=True;Connect Timeout=60;Encrypt=True;TrustServerCertificate=True";

[BeforeTestRun(Order = -1)]
public static void CreateNLogDatabaseIfNotExists()
Expand All @@ -35,17 +35,10 @@ public static void DeployDB()
var instance = new DacServices(DatabaseConnectionString);
using (var dacpac = DacPackage.Load("Ark.Reference.Core.Database.dacpac"))
{
try
instance.Deploy(dacpac, "Ark.Reference.Core.Database", true, new DacDeployOptions()
{
instance.Deploy(dacpac, "Ark.Reference.Core.Database", true, new DacDeployOptions()
{
CreateNewDatabase = true,
});
}
catch(Exception ex)
{
var a = ex;
}
CreateNewDatabase = true,
});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public static void FlushLogs()
[AfterTestRun]
public static void AfterTests()
{
Server?.Dispose();
_server?.Dispose();
}

public void Dispose()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static async Task Main(string[] args)
finally
{
NLog.LogManager.GetLogger("Main").Info("Shutting down");
NLog.LogManager.Flush();
NLog.LogManager.Shutdown();
}
}
}
Expand Down

0 comments on commit 1f2d1b5

Please sign in to comment.