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

Make exposeHostPort reusable #6410

Closed
wants to merge 12 commits into from
Closed

Make exposeHostPort reusable #6410

wants to merge 12 commits into from

Conversation

TomDeBacker
Copy link
Contributor

#3457
Container can now start when using withReuse(true) and TestContainers.exposeHostPort(). Simple if check added: if reuse is true don't call connectToPortForwardingNetwork()

@TomDeBacker TomDeBacker requested a review from a team as a code owner January 16, 2023 02:13
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.

PR is introducing unnecessary changes. Please, clean it up.

@TomDeBacker
Copy link
Contributor Author

@eddumelendez This should remove the whitespace changes, I added some extra asserts in the test.

@TomDeBacker
Copy link
Contributor Author

Not exactly sure what's going on yet.

Gradle Test Executor 1 > org.testcontainers.containers.ExposedHostTest > testExposedHostPortIsReusable STARTED
Gradle Test Executor 1 > org.testcontainers.containers.ExposedHostTest > testExposedHostPortIsReusable PASSED

Locally these tests seem to work fine.


22:18:59.699 INFO  🐳 [testcontainers/sshd:1.1.0] - Container testcontainers/sshd:1.1.0 started in PT0.369837207S
22:18:59.776 INFO  🐳 [alpine:3.16] - Creating container for image: alpine:3.16
22:18:59.851 INFO  🐳 [alpine:3.16] - Container alpine:3.16 is starting: 86e26a791c6448301c3880d302f3707e558143c2482549d8e506c8e52b495d67
22:19:00.067 INFO  🐳 [alpine:3.16] - Container alpine:3.16 started in PT0.291663502S
22:19:00.135 INFO  🐳 [alpine:3.16] - Creating container for image: alpine:3.16
22:19:00.142 INFO  🐳 [alpine:3.16] - Reusing container with ID: 86e26a791c6448301c3880d302f3707e558143c2482549d8e506c8e52b495d67 and hash: 09a6d05200a2b3e9cfaa840e5b7d715d193350ff
22:19:00.143 INFO  🐳 [alpine:3.16] - Reusing existing container (86e26a791c6448301c3880d302f3707e558143c2482549d8e506c8e52b495d67) and not creating a new one
22:19:00.144 INFO  🐳 [alpine:3.16] - Container alpine:3.16 started in PT0.009484268S

@TomDeBacker TomDeBacker marked this pull request as draft January 19, 2023 10:46
@TomDeBacker TomDeBacker marked this pull request as ready for review January 20, 2023 02:40
@TomDeBacker
Copy link
Contributor Author

TomDeBacker commented Jan 25, 2023

@eddumelendez I've made the changes you requested. Not sure how to remove the 'changes requested' flag.

@nburkley
Copy link

@eddumelendez Any updates on this PR? -We're also running into this issue. Thanks in advance!

@TomDeBacker TomDeBacker closed this by deleting the head repository May 21, 2023
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.

3 participants