Skip to content

Commit 1e96cb8

Browse files
committed
Use static HttpClient
1 parent 2ced453 commit 1e96cb8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/IntegrationTests/Helpers/HealthzHelper.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ namespace IntegrationTests.Helpers;
1111

1212
internal static class HealthzHelper
1313
{
14+
private static readonly HttpClient HttpClient = new();
15+
1416
public static async Task TestAsync(string healthzUrl, ITestOutputHelper output)
1517
{
1618
output.WriteLine($"Testing healthz endpoint: {healthzUrl}");
17-
using HttpClient client = new();
1819

1920
const int intervalMilliseconds = 500;
2021
const int maxMillisecondsToWait = 15_000;
@@ -23,7 +24,7 @@ public static async Task TestAsync(string healthzUrl, ITestOutputHelper output)
2324
{
2425
try
2526
{
26-
var response = await client.GetAsync(new Uri(healthzUrl)).ConfigureAwait(false);
27+
var response = await HttpClient.GetAsync(new Uri(healthzUrl)).ConfigureAwait(false);
2728
if (response.StatusCode == HttpStatusCode.OK)
2829
{
2930
return;

0 commit comments

Comments
 (0)