Skip to content
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

Hardened HttpClient Tests Further #29648

Merged
merged 3 commits into from
Jun 27, 2022

Conversation

alzimmermsft
Copy link
Member

Description

Hardened HttpClient tests by using WireMock functionality instead of binding a Socket manually. This should reduce transient test failures when the Socket takes a long time to be accepted.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@alzimmermsft alzimmermsft added Client This issue points to a problem in the data-plane of the library. Azure.Core azure-core HttpClient labels Jun 24, 2022
@alzimmermsft alzimmermsft self-assigned this Jun 24, 2022
@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

server.stubFor(get("/short").willReturn(aResponse().withBody(SHORT_BODY)));
server.stubFor(get("/long").willReturn(aResponse().withBody(LONG_BODY)));
server.stubFor(get("/error").willReturn(aResponse().withBody("error").withStatus(500)));
server.stubFor(WireMock.post("/shortPost").willReturn(aResponse().withBody(SHORT_BODY)));
Copy link
Member

Choose a reason for hiding this comment

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

Just to be consistent, can we use static import here as well and remove Wiremock.

@alzimmermsft alzimmermsft merged commit 4a59fa7 into Azure:main Jun 27, 2022
@alzimmermsft alzimmermsft deleted the AzHttp_HardenHttpClientTests branch June 27, 2022 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Core azure-core Client This issue points to a problem in the data-plane of the library. HttpClient
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants