kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject kafka git commit: KAFKA-4765; Fixed Intentionally Broken Hosts Resolving to 127.0.53.53 in tests
Date Thu, 16 Feb 2017 14:39:00 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk cb725c6a2 -> a1900ada7


KAFKA-4765; Fixed Intentionally Broken Hosts Resolving to 127.0.53.53 in tests

We are now using  artificially broken hosts that are not resolved as potential
collisions (127.0.53.53s) by some DNS servers.

This change is the only way to build while using Google's `8.8.8.8` (at least in my network).

Author: Armin Braun <me@obrown.io>

Reviewers: Dong Lin <lindong28@gmail.com>, Ismael Juma <ismael@juma.me.uk>

Closes #2552 from original-brownbear/KAFKA-4765


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/a1900ada
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/a1900ada
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/a1900ada

Branch: refs/heads/trunk
Commit: a1900ada7fdc3318f24e94e4aac956dca3463bbf
Parents: cb725c6
Author: Armin Braun <me@obrown.io>
Authored: Thu Feb 16 06:37:45 2017 -0800
Committer: Ismael Juma <ismael@juma.me.uk>
Committed: Thu Feb 16 06:37:52 2017 -0800

----------------------------------------------------------------------
 .../test/java/org/apache/kafka/clients/ClientUtilsTest.java    | 6 +++---
 .../org/apache/kafka/clients/consumer/KafkaConsumerTest.java   | 2 +-
 .../org/apache/kafka/clients/producer/KafkaProducerTest.java   | 2 +-
 .../java/org/apache/kafka/common/network/SelectorTest.java     | 6 +++---
 4 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/a1900ada/clients/src/test/java/org/apache/kafka/clients/ClientUtilsTest.java
----------------------------------------------------------------------
diff --git a/clients/src/test/java/org/apache/kafka/clients/ClientUtilsTest.java b/clients/src/test/java/org/apache/kafka/clients/ClientUtilsTest.java
index 2c1db44..5128f9e 100644
--- a/clients/src/test/java/org/apache/kafka/clients/ClientUtilsTest.java
+++ b/clients/src/test/java/org/apache/kafka/clients/ClientUtilsTest.java
@@ -32,7 +32,7 @@ public class ClientUtilsTest {
         check("mydomain.com:8080");
         check("[::1]:8000");
         check("[2001:db8:85a3:8d3:1319:8a2e:370:7348]:1234", "mydomain.com:10000");
-        List<InetSocketAddress> validatedAddresses = check("some.invalid.hostname.foo.bar:9999",
"mydomain.com:10000");
+        List<InetSocketAddress> validatedAddresses = check("some.invalid.hostname.foo.bar.local:9999",
"mydomain.com:10000");
         assertEquals(1, validatedAddresses.size());
         InetSocketAddress onlyAddress = validatedAddresses.get(0);
         assertEquals("mydomain.com", onlyAddress.getHostName());
@@ -43,10 +43,10 @@ public class ClientUtilsTest {
     public void testNoPort() {
         check("127.0.0.1");
     }
-    
+
     @Test(expected = ConfigException.class)
     public void testOnlyBadHostname() {
-        check("some.invalid.hostname.foo.bar:9999");
+        check("some.invalid.hostname.foo.bar.local:9999");
     }
 
     private List<InetSocketAddress> check(String... url) {

http://git-wip-us.apache.org/repos/asf/kafka/blob/a1900ada/clients/src/test/java/org/apache/kafka/clients/consumer/KafkaConsumerTest.java
----------------------------------------------------------------------
diff --git a/clients/src/test/java/org/apache/kafka/clients/consumer/KafkaConsumerTest.java
b/clients/src/test/java/org/apache/kafka/clients/consumer/KafkaConsumerTest.java
index eb0b5c8..a355aa1 100644
--- a/clients/src/test/java/org/apache/kafka/clients/consumer/KafkaConsumerTest.java
+++ b/clients/src/test/java/org/apache/kafka/clients/consumer/KafkaConsumerTest.java
@@ -117,7 +117,7 @@ public class KafkaConsumerTest {
     public void testConstructorClose() throws Exception {
         Properties props = new Properties();
         props.setProperty(ConsumerConfig.CLIENT_ID_CONFIG, "testConstructorClose");
-        props.setProperty(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "some.invalid.hostname.foo.bar:9999");
+        props.setProperty(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "some.invalid.hostname.foo.bar.local:9999");
         props.setProperty(ConsumerConfig.METRIC_REPORTER_CLASSES_CONFIG, MockMetricsReporter.class.getName());
 
         final int oldInitCount = MockMetricsReporter.INIT_COUNT.get();

http://git-wip-us.apache.org/repos/asf/kafka/blob/a1900ada/clients/src/test/java/org/apache/kafka/clients/producer/KafkaProducerTest.java
----------------------------------------------------------------------
diff --git a/clients/src/test/java/org/apache/kafka/clients/producer/KafkaProducerTest.java
b/clients/src/test/java/org/apache/kafka/clients/producer/KafkaProducerTest.java
index 13f7fda..aee6fc7 100644
--- a/clients/src/test/java/org/apache/kafka/clients/producer/KafkaProducerTest.java
+++ b/clients/src/test/java/org/apache/kafka/clients/producer/KafkaProducerTest.java
@@ -71,7 +71,7 @@ public class KafkaProducerTest {
     public void testConstructorFailureCloseResource() {
         Properties props = new Properties();
         props.setProperty(ProducerConfig.CLIENT_ID_CONFIG, "testConstructorClose");
-        props.setProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "some.invalid.hostname.foo.bar:9999");
+        props.setProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "some.invalid.hostname.foo.bar.local:9999");
         props.setProperty(ProducerConfig.METRIC_REPORTER_CLASSES_CONFIG, MockMetricsReporter.class.getName());
 
         final int oldInitCount = MockMetricsReporter.INIT_COUNT.get();

http://git-wip-us.apache.org/repos/asf/kafka/blob/a1900ada/clients/src/test/java/org/apache/kafka/common/network/SelectorTest.java
----------------------------------------------------------------------
diff --git a/clients/src/test/java/org/apache/kafka/common/network/SelectorTest.java b/clients/src/test/java/org/apache/kafka/common/network/SelectorTest.java
index a98594c..2d023e0 100644
--- a/clients/src/test/java/org/apache/kafka/common/network/SelectorTest.java
+++ b/clients/src/test/java/org/apache/kafka/common/network/SelectorTest.java
@@ -111,7 +111,7 @@ public class SelectorTest {
      */
     @Test(expected = IOException.class)
     public void testNoRouteToHost() throws Exception {
-        selector.connect("0", new InetSocketAddress("asdf.asdf.dsc", server.port), BUFFER_SIZE,
BUFFER_SIZE);
+        selector.connect("0", new InetSocketAddress("some.invalid.hostname.foo.bar.local",
server.port), BUFFER_SIZE, BUFFER_SIZE);
     }
 
     /**
@@ -261,7 +261,7 @@ public class SelectorTest {
         assertTrue("The idle connection should have been closed", selector.disconnected().contains(id));
     }
 
-    
+
     private String blockingRequest(String node, String s) throws IOException {
         selector.send(createSend(node, s));
         selector.poll(1000L);
@@ -272,7 +272,7 @@ public class SelectorTest {
                     return asString(receive);
         }
     }
-    
+
     protected void connect(String node, InetSocketAddress serverAddr) throws IOException
{
         selector.connect(node, serverAddr, BUFFER_SIZE, BUFFER_SIZE);
     }


Mime
View raw message