Skip to content
Merged
Changes from 1 commit
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 @@ -86,7 +86,7 @@ public async Task ClientSettingsReceived_Success(int headerSizeLimit)
[InlineData(1000)]
public async Task SendMoreThanStreamLimitRequests_Succeeds(int streamLimit)
{
using Http3LoopbackServer server = CreateHttp3LoopbackServer(new Http3Options(){ MaxBidirectionalStreams = streamLimit });
using Http3LoopbackServer server = CreateHttp3LoopbackServer(new Http3Options() { MaxBidirectionalStreams = streamLimit });

Task serverTask = Task.Run(async () =>
{
Expand Down Expand Up @@ -125,7 +125,7 @@ public async Task SendMoreThanStreamLimitRequests_Succeeds(int streamLimit)
[InlineData(1000)]
public async Task SendStreamLimitRequestsConcurrently_Succeeds(int streamLimit)
{
using Http3LoopbackServer server = CreateHttp3LoopbackServer(new Http3Options(){ MaxBidirectionalStreams = streamLimit });
using Http3LoopbackServer server = CreateHttp3LoopbackServer(new Http3Options() { MaxBidirectionalStreams = streamLimit });

Task serverTask = Task.Run(async () =>
{
Expand Down Expand Up @@ -169,7 +169,6 @@ public async Task SendStreamLimitRequestsConcurrently_Succeeds(int streamLimit)
[InlineData(10)]
[InlineData(100)]
[InlineData(1000)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/55901")]
public async Task SendMoreThanStreamLimitRequestsConcurrently_LastWaits(int streamLimit)
{
// This combination leads to a hang manifesting in CI only. Disabling it until there's more time to investigate.
Expand All @@ -179,7 +178,7 @@ public async Task SendMoreThanStreamLimitRequestsConcurrently_LastWaits(int stre
return;
}

using Http3LoopbackServer server = CreateHttp3LoopbackServer(new Http3Options(){ MaxBidirectionalStreams = streamLimit });
using Http3LoopbackServer server = CreateHttp3LoopbackServer(new Http3Options() { MaxBidirectionalStreams = streamLimit });
var lastRequestContentStarted = new TaskCompletionSource();

Task serverTask = Task.Run(async () =>
Expand All @@ -195,7 +194,8 @@ public async Task SendMoreThanStreamLimitRequestsConcurrently_LastWaits(int stre
}

// Make the last request running independently.
var lastRequest = Task.Run(async () => {
var lastRequest = Task.Run(async () =>
{
using Http3LoopbackStream stream = await connection.AcceptRequestStreamAsync();
await stream.HandleRequestAsync();
});
Expand Down Expand Up @@ -416,7 +416,7 @@ public async Task RequestSendingResponseDisposed_ThrowsOnServer()
RequestUri = server.Address,
Version = HttpVersion30,
VersionPolicy = HttpVersionPolicy.RequestVersionExact,
Content = new ByteAtATimeContent(60*4, Task.CompletedTask, new TaskCompletionSource<bool>(), 250)
Content = new ByteAtATimeContent(60 * 4, Task.CompletedTask, new TaskCompletionSource<bool>(), 250)
};

var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
Expand Down Expand Up @@ -723,12 +723,12 @@ public async Task ResponseCancellation_ServerReceivesCancellation(CancellationTy
using HttpClient client = CreateHttpClient();

using HttpRequestMessage request = new()
{
Method = HttpMethod.Get,
RequestUri = server.Address,
Version = HttpVersion30,
VersionPolicy = HttpVersionPolicy.RequestVersionExact
};
{
Method = HttpMethod.Get,
RequestUri = server.Address,
Version = HttpVersion30,
VersionPolicy = HttpVersionPolicy.RequestVersionExact
};
HttpResponseMessage response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).WaitAsync(TimeSpan.FromSeconds(10));

Stream stream = await response.Content.ReadAsStreamAsync();
Expand Down Expand Up @@ -785,7 +785,7 @@ public async Task ResponseCancellation_BothCancellationTokenAndDispose_Success()

HttpRequestData request = await stream.ReadRequestDataAsync().ConfigureAwait(false);

int contentLength = 2*1024*1024;
int contentLength = 2 * 1024 * 1024;
var headers = new List<HttpHeaderData>();
headers.Append(new HttpHeaderData("Content-Length", contentLength.ToString(CultureInfo.InvariantCulture)));

Expand All @@ -810,12 +810,12 @@ public async Task ResponseCancellation_BothCancellationTokenAndDispose_Success()
using HttpClient client = CreateHttpClient();

using HttpRequestMessage request = new()
{
Method = HttpMethod.Get,
RequestUri = server.Address,
Version = HttpVersion30,
VersionPolicy = HttpVersionPolicy.RequestVersionExact
};
{
Method = HttpMethod.Get,
RequestUri = server.Address,
Version = HttpVersion30,
VersionPolicy = HttpVersionPolicy.RequestVersionExact
};
HttpResponseMessage response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).WaitAsync(TimeSpan.FromSeconds(20));

Stream stream = await response.Content.ReadAsStreamAsync();
Expand Down Expand Up @@ -917,12 +917,12 @@ public async Task Alpn_NonH3_NegotiationFailure()
using HttpClient client = CreateHttpClient();

using HttpRequestMessage request = new()
{
Method = HttpMethod.Get,
RequestUri = server.Address,
Version = HttpVersion30,
VersionPolicy = HttpVersionPolicy.RequestVersionExact
};
{
Method = HttpMethod.Get,
RequestUri = server.Address,
Version = HttpVersion30,
VersionPolicy = HttpVersionPolicy.RequestVersionExact
};

HttpRequestException ex = await Assert.ThrowsAsync<HttpRequestException>(() => client.SendAsync(request).WaitAsync(TimeSpan.FromSeconds(10)));
Assert.Contains("ALPN_NEG_FAILURE", ex.Message);
Expand Down Expand Up @@ -1057,7 +1057,7 @@ public async Task EchoServerStreaming_DifferentMessageSize_Success(int messageSi

var responseTask = client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).WaitAsync(TimeSpan.FromSeconds(10));

Stream requestStream = await requestContent.GetStreamAsync().WaitAsync(TimeSpan.FromSeconds(10));;
Stream requestStream = await requestContent.GetStreamAsync().WaitAsync(TimeSpan.FromSeconds(10)); ;
// Send headers
await requestStream.FlushAsync();

Expand Down