Change fixture default host to localhost #1305
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@dpkp, I think the current errors with the Travis build may be because the VM have IPv6 disabled and since the fixtures are forcing the use of IPv6 the Kafka broker cannot bind to a valid address. If this is indeed the case, however, I'm not sure what happened recently that caused builds start failing.
I had a look at the
KafkaFixture
code and saw the comment saying that if the broker binds to an IPv4 address, then "kafka-python will attempt to connect on ::1 and fail".I'm not sure why that's the case. I checked the code and couldn't find an explanation. Maybe this has been changed since?
I'm also not quite sure what's the use of the bracket notation for the broker address (e.g.
[::1]
). I couldn't find a reference to it in the Kafka documentation. I noticed that it doesn't work with "localhost". If I set the default address to[localhost]
the tests fail. However, if the address is set to simplylocalhost
it seems to work fine on hosts with IPv6 enabled or disabled.I tested this change on two different VMs: one with IPv6 enabled and the other with IPv6 disabled. All tests passed. So I'm sending this PR to see how it goes on Travis.