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 @@ -531,15 +531,17 @@ await RemoteExecutor.Invoke(static async (testClassName, eventNameInner) =>

private async Task RequestDuration_CustomTags_DiagnosticListener_Recorded_Core(string eventName)
{
HttpResponseMessage? enrichmentResponse = null;

FakeDiagnosticListenerObserver diagnosticListenerObserver = new(kv =>
{
if (kv.Key == eventName)
{
HttpRequestMessage request = GetProperty<HttpRequestMessage>(kv.Value, "Request");
HttpMetricsEnrichmentContext.AddCallback(request, static ctx =>
HttpMetricsEnrichmentContext.AddCallback(request, ctx =>
{
ctx.AddCustomTag("observed?", "observed!");
Assert.NotNull(ctx.Response);
enrichmentResponse = ctx.Response;
});
}
});
Expand All @@ -558,6 +560,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
});

using HttpResponseMessage response = await SendAsync(client, request);
Assert.Same(response, enrichmentResponse);

Measurement<double> m = Assert.Single(recorder.GetMeasurements());
VerifyRequestDuration(m, uri, UseVersion, 200);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public bool RemoteCertificateValidationCallback(object sender, X509Certificate?
public async Task<QuicException> AssertThrowsQuicExceptionAsync(QuicError expectedError, Func<Task> testCode)
{
QuicException ex = await Assert.ThrowsAsync<QuicException>(testCode);
_output.WriteLine(ex.ToString());
_output?.WriteLine(ex.ToString());
Assert.Equal(expectedError, ex.QuicError);
return ex;
}
Expand Down Expand Up @@ -226,7 +226,7 @@ internal ValueTask<QuicListener> CreateQuicListener(IPEndPoint endpoint, Action<
}
catch (QuicException ex) when (ex.HResult == (int)SocketError.ConnectionRefused)
{
_output.WriteLine($"ConnectAsync to {clientOptions.RemoteEndPoint} failed with {ex.Message}");
_output?.WriteLine($"ConnectAsync to {clientOptions.RemoteEndPoint} failed with {ex.Message}");
await Task.Delay(delay);
delay *= 2;

Expand Down Expand Up @@ -323,15 +323,15 @@ await new[]
}
catch (ObjectDisposedException ex)
{
_output.WriteLine(ex.ToString());
_output?.WriteLine(ex.ToString());
}
try
{
await clientConnection.CloseAsync(ClientCloseErrorCode);
}
catch (ObjectDisposedException ex)
{
_output.WriteLine(ex.ToString());
_output?.WriteLine(ex.ToString());
}
}
}
Expand Down
Loading