Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

Commit 455d865

Browse files
committed
Fixing deadlock hang in test when running in single threaded environment
1 parent 3325bfc commit 455d865

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Microsoft.AspNet.TestHost/ClientHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ protected override async Task<HttpResponseMessage> SendAsync(
9494
}
9595
});
9696

97-
return await state.ResponseTask;
97+
return await state.ResponseTask.ConfigureAwait(false);
9898
}
9999

100100
private class RequestState

test/Microsoft.AspNet.TestHost.Tests/TestServerTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ public async Task DisposedServerThrows()
353353

354354
[ConditionalFact]
355355
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
356-
public void CancelAborts()
356+
public async Task CancelAborts()
357357
{
358358
TestServer server = TestServer.Create(app =>
359359
{
@@ -365,7 +365,7 @@ public void CancelAborts()
365365
});
366366
});
367367

368-
Assert.Throws<AggregateException>(() => { string result = server.CreateClient().GetStringAsync("/path").Result; });
368+
await Assert.ThrowsAsync<TaskCanceledException>(async () => { string result = await server.CreateClient().GetStringAsync("/path"); });
369369
}
370370

371371
[ConditionalFact]

0 commit comments

Comments
 (0)