Skip to content

Commit 41e5b4c

Browse files
bgavrilMSCopilot
andauthored
Update tests/Microsoft.Identity.Test.Unit/CoreTests/HttpTests/HttpClientFactoryTests.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 330c435 commit 41e5b4c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/Microsoft.Identity.Test.Unit/CoreTests/HttpTests/HttpClientFactoryTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ public void TestGetHttpClient_DoesNotLeakHttpClients()
9393

9494
// Assert - CreateHttpClient should be called exactly once.
9595
// Before the fix, GetOrAdd(key, CreateHttpClient()) eagerly evaluates
96-
// CreateHttpClient() on every call, leaking HttpClientHandler sockets.
96+
// CreateHttpClient() on every call, causing unnecessary throwaway
97+
// HttpClient/HttpClientHandler allocations.
9798
Assert.AreEqual(1, created,
9899
$"CreateHttpClient was called {created} times for 3 lookups. " +
99100
"Use GetOrAdd(key, factory_delegate) to avoid creating throwaway HttpClient instances.");

0 commit comments

Comments
 (0)