Fixing deadlock hang in test when running in single threaded environment
This commit is contained in:
parent
3325bfc653
commit
455d865948
|
|
@ -94,7 +94,7 @@ namespace Microsoft.AspNet.TestHost
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return await state.ResponseTask;
|
return await state.ResponseTask.ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class RequestState
|
private class RequestState
|
||||||
|
|
|
||||||
|
|
@ -353,7 +353,7 @@ namespace Microsoft.AspNet.TestHost
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
|
||||||
public void CancelAborts()
|
public async Task CancelAborts()
|
||||||
{
|
{
|
||||||
TestServer server = TestServer.Create(app =>
|
TestServer server = TestServer.Create(app =>
|
||||||
{
|
{
|
||||||
|
|
@ -365,7 +365,7 @@ namespace Microsoft.AspNet.TestHost
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
Assert.Throws<AggregateException>(() => { string result = server.CreateClient().GetStringAsync("/path").Result; });
|
await Assert.ThrowsAsync<TaskCanceledException>(async () => { string result = await server.CreateClient().GetStringAsync("/path"); });
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue