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

[Enhancement]: Alternative waiting strategy for Mockserver container #6951

Conversation

DenilssonMontoya
Copy link
Contributor

Hi

As discussed in #6647, this PR changes the Waiting Strategy for Mockserver container so it becomes possible for it to work with HTTP and HTTPS requests.

Test cases were implemented to validate successful HTTPS requests to Mockserver, testing both cases when requests are made using TLS and mTLS which is described in Mockserver docs https://www.mock-server.com/mock_server/HTTPS_TLS.html

…rHttp for Wait.forLogMessage. This change will allow Mockserver to work with HTTP and HTTPS requests.
@DenilssonMontoya DenilssonMontoya requested a review from a team as a code owner May 1, 2023 10:27
Copy link
Member

@eddumelendez eddumelendez left a comment

Choose a reason for hiding this comment

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

LGTM!

@eddumelendez eddumelendez added this to the next milestone May 2, 2023
@eddumelendez eddumelendez merged commit cce90eb into testcontainers:main May 2, 2023
@eddumelendez
Copy link
Member

Thank you so much for your contribution, @DenilssonMontoya ! This is now merged in main branch and it will be available as part of the next release.

@DenilssonMontoya
Copy link
Contributor Author

Thank you so much! Glad I could help!

@@ -36,7 +36,7 @@ public MockServerContainer(DockerImageName dockerImageName) {
super(dockerImageName);
dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME, DockerImageName.parse("mockserver/mockserver"));

waitingFor(Wait.forHttp("/mockserver/status").withMethod("PUT").forStatusCode(200));
waitingFor(Wait.forLogMessage(".*started on port: " + PORT + ".*", 1));
Copy link

Choose a reason for hiding this comment

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

this actually broke our podman rootless execution waiting for mockserver. We went back to the http status check. I wonder why using the default listening for the first exposed is not good enough?

DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-0 << "{"cause":"using --follow with the journald --log-driver but without the journald --events-backend (file) is not supported","message":"failed to obtain logs for Container '33ea4476017d4c49d84f2be6ec2eb7d0eae37ca064bdbab3c8771951f132ab2b': using --follow with the journald --log-driver but without the journald --events-backend (file) is not supported","response":500}[\n]"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants