Skip to content

Increase retry_count for server_running to 10 to account for slower startup times of Wiremock #112

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jonassvalin
Copy link

@jonassvalin jonassvalin commented Jan 7, 2025

I am using python-wiremock in a project I'm working on. When running with docker-desktop it works fine, but when I switch to colima as the host it appears that it takes slightly longer for the Wiremock server to get ready in the container. I'm running on an M2 Mac.

This is the error I get:

Waiting for container <Container: da6d6427c7f6> with image wiremock/wiremock:2.35.1-1 to be ready ...
Waiting for container <Container: da6d6427c7f6> with image wiremock/wiremock:2.35.1-1 to be ready ...
Request failed: HTTPConnectionPool(host='localhost', port=32847): Max retries exceeded with url: /__admin/mappings (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10dc21be0>: Failed to establish a new connection: [Errno 61] Connection refused'))
Waiting for container <Container: da6d6427c7f6> with image wiremock/wiremock:2.35.1-1 to be ready ...
Request failed: HTTPConnectionPool(host='localhost', port=32847): Max retries exceeded with url: /__admin/mappings (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10dc70550>: Failed to establish a new connection: [Errno 61] Connection refused'))
Waiting for container <Container: da6d6427c7f6> with image wiremock/wiremock:2.35.1-1 to be ready ...
Request failed: HTTPConnectionPool(host='localhost', port=32847): Max retries exceeded with url: /__admin/mappings (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10dc70a50>: Failed to establish a new connection: [Errno 61] Connection refused'))
ERROR                                                                                                                                                                                                                                                      [ 21%]

If I go in to the server_running function in python-wiremock and manually bump up the retry_count to 10 (as per this PR) then it works fine, on the 4th attempt it successfully connects to wiremock.

I think a cleaner solution to my problem would be if we could expose the retry_count as configuration, but I don't have the time to contribute such a major change at the moment. This would solve my problem in the short term, at least.

References

No relevant 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

@jonassvalin
Copy link
Author

@oleg-nenashev Do you have a chance to look at this perhaps?

@jonassvalin
Copy link
Author

Maybe @leeturner ?

@FraterCRC
Copy link

Is this package abandoned?

@jonassvalin
Copy link
Author

Is this package abandoned?

I have not been able to reach any of the maintainers unfortunately

@jonassvalin
Copy link
Author

@oleg-nenashev @leeturner any chance of looking at this?

@alexjrk
Copy link
Contributor

alexjrk commented Apr 29, 2025

This looks like a safe workaround until we come up with a better solution. I don't see any potential issues arising from this change.

@jonassvalin
Copy link
Author

@alexjrk thank you! How do we get this merged and released?

@leeturner
Copy link
Contributor

I am happy to merge the PR. Not sure at this point how this gets released as I haven't worked on this componenet before

@alexjrk
Copy link
Contributor

alexjrk commented Apr 30, 2025

I just saw that the master branch is actually used for WireMock v2, so I think we should add WireMock v3-related changes to a separate branch (I noticed we already have one called version_3). Then, we can create a new tag (maybe 2.6.2, depending on which new changes we include) for deploying the new release.

@alexjrk
Copy link
Contributor

alexjrk commented Apr 30, 2025

Maybe create a tag on this commit, move all the later commits to the version_3 branch, and then add this change to master to create a new release?

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.

4 participants