Skip to content

Convert Sync RemoteExecutors to Async on Http Tests #115422

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

Merged
merged 2 commits into from
May 9, 2025

Conversation

liveans
Copy link
Member

@liveans liveans commented May 9, 2025

Applied a generic regex to convert Sync RemoteExecutors tests to Async, might fix some cases, as we observed in the past.
See for more info: #102699

@liveans liveans requested review from Copilot and a team May 9, 2025 11:45
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request updates several test methods that previously used synchronous RemoteExecutor calls to now use asynchronous calls via await and DisposeAsync, improving test reliability and potential resource management.

  • Converted test methods in RuntimeSettingParserTest, TelemetryTest, DiagnosticsTests, HttpClientAuthenticationTest, and HttpClientHandlerTest.Proxy from void to async Task.
  • Updated RemoteExecutor.Invoke calls to be awaited with DisposeAsync for proper asynchronous disposal.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/libraries/System.Net.Http/tests/UnitTests/RuntimeSettingParserTest.cs Converted synchronous test methods to async patterns.
src/libraries/System.Net.Http/tests/FunctionalTests/TelemetryTest.cs Adjusted async lambda and disposal for async testing.
src/libraries/System.Net.Http/tests/FunctionalTests/DiagnosticsTests.cs Updated async test methods with proper async disposal.
src/libraries/System.Net.Http/tests/EnterpriseTests/HttpClientAuthenticationTest.cs Modified synchronous authentication tests to async.
src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Proxy.cs Changed sync proxy test to async using await for disposal.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

@wfurt
Copy link
Member

wfurt commented May 9, 2025

should the awaits have some timeout? While this makes it more friendly to Unit, we can still block indefinitely (or very long time), right?

@liveans
Copy link
Member Author

liveans commented May 9, 2025

should the awaits have some timeout? While this makes it more friendly to Unit, we can still block indefinitely (or very long time), right?

No, RemoteExecutor already has timeout mechanism by default it's 60 sec IIRC.

Copy link
Member

@wfurt wfurt left a comment

Choose a reason for hiding this comment

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

LGTM

@liveans liveans merged commit 0e06c21 into dotnet:main May 9, 2025
81 of 85 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants