Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1973,7 +1973,7 @@ public async Task Http2_SendOverConnectionWindowSizeWithoutExplicitFlush_ClientS
[ConditionalFact(typeof(HttpClientHandlerTest_Http2), nameof(SupportsAlpn))]
public async Task Http2_MaxConcurrentStreams_LimitEnforced()
{
using (Http2LoopbackServer server = Http2LoopbackServer.CreateServer())
using (Http2LoopbackServer server = Http2LoopbackServer.CreateServer(new Http2Options { EnsureThreadSafeIO = true }))
using (HttpClient client = CreateHttpClient())
{
Task<HttpResponseMessage> sendTask = client.GetAsync(server.Address);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public sealed class SocketsHttpHandler_Http2KeepAlivePing_Test : HttpClientHandl
private TaskCompletionSource _serverFinished = new TaskCompletionSource();
private bool _sendPingResponse = true;

private static Http2Options NoAutoPingResponseHttp2Options => new Http2Options() { EnableTransparentPingResponse = false };
private static Http2Options NoAutoPingResponseHttp2Options => new Http2Options() { EnableTransparentPingResponse = false, EnsureThreadSafeIO = true };

private static readonly TimeSpan TestTimeout = TimeSpan.FromSeconds(60);

Expand Down Expand Up @@ -92,7 +92,7 @@ await Http2LoopbackServer.CreateClientAndServerAsync(async uri =>
Assert.True(_pingCounter <= 1);

await TerminateLoopbackConnectionAsync();
});
}, new Http2Options { EnsureThreadSafeIO = true });
}

[OuterLoop("Runs long")]
Expand Down Expand Up @@ -566,7 +566,6 @@ private async Task ProcessIncomingFramesAsync(CancellationToken cancellationToke
}

_output?.WriteLine("ProcessIncomingFramesAsync finished");
await _connection.DisposeAsync();
}

private async Task EstablishConnectionAsync(Http2LoopbackServer server, params SettingsEntry[] settingsEntries)
Expand All @@ -580,6 +579,7 @@ private async Task TerminateLoopbackConnectionAsync()
_serverFinished.SetResult();
_incomingFramesCts.Cancel();
await _incomingFramesTask;
await _connection.DisposeAsync();
}

private async Task GuardConnectionWriteAsync(Func<Task> action, CancellationToken cancellationToken = default)
Expand Down
Loading