Fix flaxy test (#1079)
This commit is contained in:
parent
c7bac3133f
commit
b6f558d60b
|
|
@ -158,8 +158,8 @@ namespace Microsoft.AspNetCore.Hosting
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact (Skip="https://github.com/aspnet/Hosting/issues/1024")]
|
[Fact]
|
||||||
public void WebHostShutsDownWhenTokenTriggers()
|
public async Task WebHostShutsDownWhenTokenTriggers()
|
||||||
{
|
{
|
||||||
using (var host = CreateBuilder()
|
using (var host = CreateBuilder()
|
||||||
.UseFakeServer()
|
.UseFakeServer()
|
||||||
|
|
@ -184,6 +184,9 @@ namespace Microsoft.AspNetCore.Hosting
|
||||||
// Wait on the host to shutdown
|
// Wait on the host to shutdown
|
||||||
lifetime.ApplicationStopped.WaitHandle.WaitOne();
|
lifetime.ApplicationStopped.WaitHandle.WaitOne();
|
||||||
|
|
||||||
|
// Wait for RunAsync to finish to guarantee Disposal of WebHost
|
||||||
|
await runInBackground;
|
||||||
|
|
||||||
Assert.Equal(1, server.StartInstances[0].DisposeCalls);
|
Assert.Equal(1, server.StartInstances[0].DisposeCalls);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue