Skip to content

Commit 141b6b2

Browse files
asdaraujodpkp
authored andcommitted
Change fixture default host to localhost (#1305)
1 parent 27da916 commit 141b6b2

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

test/fixtures.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -191,22 +191,8 @@ def instance(cls, broker_id, zk_host, zk_port, zk_chroot=None,
191191
(host, port) = (parse.hostname, parse.port)
192192
fixture = ExternalService(host, port)
193193
else:
194-
# force IPv6 here because of a confusing point:
195-
#
196-
# - if the string "localhost" is passed, Kafka will *only* bind to the IPv4 address of localhost
197-
# (127.0.0.1); however, kafka-python will attempt to connect on ::1 and fail
198-
#
199-
# - if the address literal 127.0.0.1 is passed, the metadata request during bootstrap will return
200-
# the name "localhost" and we'll go back to the first case. This is odd!
201-
#
202-
# Ideally, Kafka would bind to all loopback addresses when we tell it to listen on "localhost" the
203-
# way it makes an IPv6 socket bound to both 0.0.0.0/0 and ::/0 when we tell it to bind to "" (that is
204-
# to say, when we make a listener of PLAINTEXT://:port.
205-
#
206-
# Note that even though we specify the bind host in bracket notation, Kafka responds to the bootstrap
207-
# metadata request without square brackets later.
208194
if host is None:
209-
host = "[::1]"
195+
host = "localhost"
210196
fixture = KafkaFixture(host, port, broker_id,
211197
zk_host, zk_port, zk_chroot,
212198
transport=transport,

0 commit comments

Comments
 (0)