Skip to content

Fix test proxy network calls #45130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

billwert
Copy link
Contributor

Fixes a bunch of places where we were not properly closing a HttpResponse.

@azure-sdk
Copy link
Collaborator

azure-sdk commented Apr 25, 2025

API Change Check

APIView identified API level changes in this PR and created the following API reviews

com.azure:azure-core-test

@billwert billwert requested review from g2vinay, joshfree and a team as code owners May 6, 2025 18:39
@billwert billwert requested a review from maorleger May 6, 2025 18:39
@billwert billwert force-pushed the fix-test-proxy-network-calls branch from 8f52e72 to f353fb3 Compare May 6, 2025 18:46
@@ -331,7 +332,10 @@ public HttpClient getPlaybackClient() {
throw new IllegalStateException("A playback client can only be requested in PLAYBACK mode.");
}
if (testProxyPlaybackClient == null) {
testProxyPlaybackClient = new TestProxyPlaybackClient(httpClient, skipRecordingRequestBody);
// reactor.netty.http.client.HttpClient client = reactor.netty.http.client.HttpClient.create().wiretap("reactor.netty.http.client.HttpClient", LogLevel.TRACE, AdvancedByteBufFormat.TEXTUAL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you want to remove this commented out code or if not add another comment above explaining when someone would want to make a swap here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely. This is really a draft PR at this point as we continue to chase down the problems. I'll clean a lot of things up when I'm done.

while (true) {
try {
HttpResponse response = client.sendSync(request, Context.NONE);
if (response.getStatusCode() / 100 != 2) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a helper since it's used multiple times

@billwert billwert marked this pull request as draft May 7, 2025 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Core azure-core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants