-
-
Notifications
You must be signed in to change notification settings - Fork 715
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
get_ip: handle getting 0.0.0.0 (#2554) #8712
Conversation
I honestly kinda preferred my other thought here:
which sends
and it seems like pytest treats warnings during test collection as errors, so when we run the tests in the build environment with that change, they blow up during collection:
and I can't figure out how to tell pytest not to do that :/ So that has problems. OTOH now I'm running the entire test suite with this PR I think it might be causing other failures. sigh. |
argh, yeah, this breaks because |
Unit Test ResultsSee test report for an extended history of previous test failures. This is useful for diagnosing flaky tests. 29 files ±0 29 suites ±0 10h 55m 18s ⏱️ - 7m 38s For more details on these failures, see this check. Results for commit 1becd4a. ± Comparison against base commit adcb045. ♻️ This comment has been updated with latest results. |
6fa93a1
to
20abd5b
Compare
OK, there's a different version that targets |
In Fedora's package build environment, we do some stuff to ensure no network access is possible (this is to ensure the security, policy compliance and reproducibility of builds, and also just so builds don't fail or go slow or run up big networking bills). In this environment it seems like `get_ip()` returns `"0.0.0.0"`, which is obviously not a concrete host, but `ensure_concrete_host` goes ahead and returns what it gets from `get_ip()` without checking. This ultimately breaks several tests because a server's host is considered to be `"0.0.0.0"`. So, let's have `get_ip()` use the fallback to `getaddrinfo` if the result of the socket path is `"0.0.0.0"`, but avoid the warning, because pytest seems to consider warnings during test collection as errors and we hit this code during test collection in the affected scenario. Signed-off-by: Adam Williamson <awilliam@redhat.com>
20abd5b
to
1becd4a
Compare
The test failures all look like flakes to me, not obviously ones that would be caused by this change. |
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 looks fine to me, I agree that the test failures are unrelated.
Thanks for iterating here @AdamWill!
In Fedora's package build environment, we do some stuff to ensure no network access is possible (this is to ensure the security, policy compliance and reproducibility of builds, and also just so builds don't fail or go slow or run up big networking bills).
In this environment it seems like
get_ip()
returns"0.0.0.0"
, which is obviously not a concrete host, butensure_concrete_host
goes ahead and returns what it gets fromget_ip()
without checking. This ultimately breaks several tests because a server's host is considered to be"0.0.0.0"
.So, let's have
get_ip()
use the fallback togetaddrinfo
if the result of the socket path is"0.0.0.0"
, but avoid the warning, because pytest seems to consider warnings during test collection as errors and we hit this code during test collection in the affected scenario.Closes #2554
pre-commit run --all-files