-
Notifications
You must be signed in to change notification settings - Fork 3k
Test server listening on IPv4/IPv6 #2255
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
Conversation
The error we get is It was reported here: moby/moby#41438 Ubuntu 24.04 runner uses That's why I was not able to reproduce it locally, and self-hosted runners were working properly (they were using docker from docker repo, not ubuntu, so, more or less recent version has been installed). My guess is that if I install latest docker inside our runners, it will work just fine. |
# Give some time for server to start | ||
finish_time = time.time() + 10 | ||
sleep_time = 1 | ||
while time.time() < finish_time: | ||
time.sleep(sleep_time) | ||
try: | ||
requests.get("http://localhost:8888/api") | ||
break | ||
except requests.RequestException: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a bug here - we fall through no matter if requests was successful or not, will fix it
When running from python still uses old version |
Thanks for following this up, been busy with too many other things! |
Yep, made it work, now it's time to make it work for other tests as well 😃 |
@@ -4,7 +4,6 @@ | |||
from docker.models.containers import Container | |||
|
|||
|
|||
def get_health(container: Container) -> str: | |||
api_client = docker.APIClient() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is funny coincidence.
I refactored code around health check earlier today 😃
Didn't notice this bug.
We're using separate API client here, not the one from the docker_client
fixture.
That's why it was impossible to make both healthcheck and ipv6 tests work.
Passing client as param and using it should fix the problem
- name: Set Up Docker 🐳 | ||
uses: docker/setup-docker-action@b60f85385d03ac8acfca6d9996982511d8620a19 # v4.3.0 | ||
with: | ||
set-host: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This magic option changes anything - using it there is need to change other code around docker client creation, it will automatically use the latest docker client.
It is also more general, as it will also work for other places where we're creating docker client - in tagging, for example.
|
Wieeee nice debugging effort into this @mathbunnyru!!!! |
@manics @consideRatio may I ask you to review this change? Fun fact - I didn't even read what code by @manics about ipv6 does while doing all this 😆 @manics please, also tell me if you're ok if I just squash merge this PR as is (so the commit will be under my name). |
Thanks! It's nice that when GitHub runners update their Docker version, we can just remove setup action, and everything else will stay the same (no changes to code at all). |
Fine with me! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems right! Thank you @manics and @mathbunnyru!!
Thanks! All the images build and test just fine. |
Describe your changes
Issue ticket if applicable
Checklist (especially for first-time contributors)