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

Disable connection reuse only for proxy clients not for the admin client #2597

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

coder-hugo
Copy link
Contributor

We are using WireMock for our integration tests. In one of our projects the test suite does ~ 29000 requests to the WireMock for stubbing, verifying, resetting ... requests. With the current implementation for each and every request a new TCP connection is created. This causes a lot of useless overhead. On powerful systems the test suite takes just 1 minute and a few seconds and it looks like we now reached a limit where some kind of ratelimiting (haven't yet found the reason for) on the network layer blocks the creation of new TCP connections to the WireMock. If I enable the connection reuse everything works as expected.
I just had a look through the history and it looks like disabling the connection reuse was introduced due to a bug that occurs when the WireMock server is running in proxy mode. Therefore this feature should only be disabled in these cases. (Btw. I don't think it's a good idea to mix-up the configuration of clients that are used for completely different use cases.)

To provide a test for this a added a small dummy server that just accepts a single connection. If you disable the connection reuse feature you will see it failing.

References

Submitter checklist

  • Recommended: Join WireMock Slack to get any help in #help-contributing or a project-specific channel like #wiremock-java
  • The PR request is well described and justified, including the body and the references
  • The PR title represents the desired changelog entry
  • The repository's code style is followed (see the contributing guide)
  • Test coverage that demonstrates that the change works as expected
  • For new features, there's necessary documentation in this pull request or in a subsequent PR to wiremock.org

@coder-hugo coder-hugo requested a review from a team as a code owner January 31, 2024 10:01
@tomakehurst tomakehurst merged commit fbf347a into wiremock:master Feb 5, 2024
7 checks passed
@tomakehurst
Copy link
Member

Thanks!

@coder-hugo coder-hugo deleted the feature/reuse-connections branch February 12, 2024 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants