From 141b6b29609f9594ad9d3d3302a0123d1b831261 Mon Sep 17 00:00:00 2001 From: Andre Araujo Date: Tue, 5 Dec 2017 09:47:38 -0800 Subject: Change fixture default host to localhost (#1305) --- test/fixtures.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/test/fixtures.py b/test/fixtures.py index 62a1980..661a631 100644 --- a/test/fixtures.py +++ b/test/fixtures.py @@ -191,22 +191,8 @@ class KafkaFixture(Fixture): (host, port) = (parse.hostname, parse.port) fixture = ExternalService(host, port) else: - # force IPv6 here because of a confusing point: - # - # - if the string "localhost" is passed, Kafka will *only* bind to the IPv4 address of localhost - # (127.0.0.1); however, kafka-python will attempt to connect on ::1 and fail - # - # - if the address literal 127.0.0.1 is passed, the metadata request during bootstrap will return - # the name "localhost" and we'll go back to the first case. This is odd! - # - # Ideally, Kafka would bind to all loopback addresses when we tell it to listen on "localhost" the - # 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 - # to say, when we make a listener of PLAINTEXT://:port. - # - # Note that even though we specify the bind host in bracket notation, Kafka responds to the bootstrap - # metadata request without square brackets later. if host is None: - host = "[::1]" + host = "localhost" fixture = KafkaFixture(host, port, broker_id, zk_host, zk_port, zk_chroot, transport=transport, -- cgit v1.2.1