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

Catch and retry DockerClient.port() #230

Conversation

jmorales4
Copy link
Contributor

DockerClient.port() fails when called too quickly (from DockerContainer.get_exposed_port) after container start. Wrap DockerContainer.get_exposed_port in wait_container_is_ready() and change DockerClient.port to raise ConnectionError so that it can be caught and retried.

…er.get_exposed_port) after container start. Wrap DockerContainer.get_exposed_port in wait_container_is_ready() and change DockerClient.port to raise ConnectionError so that it can be caught and retried.
@codecov-commenter
Copy link

codecov-commenter commented Jul 25, 2022

Codecov Report

Merging #230 (5605511) into master (99a3252) will increase coverage by 0.03%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##           master     #230      +/-   ##
==========================================
+ Coverage   86.56%   86.60%   +0.03%     
==========================================
  Files          27       27              
  Lines         722      724       +2     
  Branches       65       65              
==========================================
+ Hits          625      627       +2     
  Misses         76       76              
  Partials       21       21              
Impacted Files Coverage Δ
testcontainers/core/docker_client.py 51.16% <0.00%> (ø)
testcontainers/core/container.py 77.08% <100.00%> (+0.48%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us.

@tillahoffmann tillahoffmann linked an issue Aug 6, 2022 that may be closed by this pull request
@tillahoffmann tillahoffmann merged commit 24e1393 into testcontainers:master Aug 6, 2022
@pffijt
Copy link
Collaborator

pffijt commented Aug 11, 2022

I ran into this issue on my enviromnent, any plans to release this fix?

@tillahoffmann
Copy link
Collaborator

Should be done in 3.6.1 once the upload finishes.

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.

Some containers fail to start due to exposed port race condition
4 participants