public async Task ServerSendsTrailingHeaders_Success()
{
using Http3LoopbackServer server = CreateHttp3LoopbackServer();
+ SemaphoreSlim clientFinishedSemaphore = new SemaphoreSlim(0);
Task serverTask = Task.Run(async () =>
{
await requestStream.ReadRequestDataAsync();
await requestStream.SendResponseAsync(isFinal: false);
await requestStream.SendResponseHeadersAsync(null, new[] { new HttpHeaderData("MyHeader", "MyValue") });
+ await clientFinishedSemaphore.WaitAsync(TimeSpan.FromSeconds(20));
});
Task clientTask = Task.Run(async () =>
(string key, IEnumerable<string> value) = Assert.Single(response.TrailingHeaders);
Assert.Equal("MyHeader", key);
Assert.Equal("MyValue", Assert.Single(value));
+ clientFinishedSemaphore.Release();
});
await new[] { clientTask, serverTask }.WhenAllOrAnyFailed(200_000);