Improve deadlock in TestHost
MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Integration/WabiSabiApiApplicationFactory.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Integration/WabiSabiApiApplicationFactory.cs
@@ -25,6 +25,15 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Integration
{
public class WabiSabiApiApplicationFactory<TStartup> : WebApplicationFactory<TStartup> where TStartup : class
{
+ // There is a deadlock in the current version of the asmp.net testing framework
+ // https://www.strathweb.com/2021/05/the-curious-case-of-asp-net-core-integration-test-deadlock/
+ protected override IHost CreateHost(IHostBuilder builder)
+ {
+ var host = builder.Build();
+ Task.Run(() => host.StartAsync()).GetAwaiter().GetResult();
+ return host;
+ }
+
protected override IHostBuilder CreateHostBuilder()
{
var builder = Host.CreateDefaultBuilder().ConfigureWebHostDefaults(x =>

Improve deadlock in TestHost