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

Listen explicitly on localhost on heartbeat TCP tests #15583

Merged
merged 2 commits into from
Jan 15, 2020

Conversation

jsoriano
Copy link
Member

Some tests were requiring localhost to resolve to 127.0.0.1, but this is
not always the case. In some machines localhost resolve to other local
addresses as 127.0.1.1, or to [::1] if ipv4 is not available.

httptest.NewServer always binds to 127.0.0.1, so connections to
localhost can fail if localhost resolves to a different IP.

Explicitly use localhost when binding and later expecting name resolution.

Issue seen in Travis when upgrading the Ubuntu image during the
migration to Python 3, can be reproduced by modifying /etc/hosts to
use an IP different to 127.0.0.1 as localhost.

Some tests were requiring localhost to resolve to 127.0.0.1, but this is
not always the case. In some machines localhost resolve to other local
addresses as 127.0.1.1, or to [::1] if ipv4 is not available.
@@ -1,5 +1,5 @@
Elastic Beats
Copyright 2014-2019 Elasticsearch BV
Copyright 2014-2020 Elasticsearch BV
Copy link
Member Author

Choose a reason for hiding this comment

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

Not related to this change but required in the python 3 branch.

@jsoriano jsoriano merged commit 3c908d1 into elastic:feature/python3 Jan 15, 2020
@jsoriano jsoriano deleted the heartbeat-localhost-test branch January 15, 2020 18:10
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
Some tests were requiring localhost to resolve to 127.0.0.1, but this is
not always the case. In some machines localhost resolve to other local
addresses as 127.0.1.1, or to [::1] if ipv4 is not available.
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.

2 participants