You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by gw...@apache.org on 2016/01/21 20:18:30 UTC

kafka git commit: KAFKA-3080: Fix ConsoleConsumerTest by checking version when service is started

Repository: kafka
Updated Branches:
  refs/heads/trunk 79cda0472 -> 9577dc235


KAFKA-3080: Fix ConsoleConsumerTest by checking version when service is started

The MessageFormatter being used was only introduced as of 0.9.0.0. The Kafka
version in some tests is changed dynamically, sometimes from trunk back to an
earlier version, so this option must be set based on the version used when the
service is started, not when it is created.

Author: Ewen Cheslack-Postava <me...@ewencp.org>

Reviewers: Geoff Anderson, Ismael Juma, Grant Henke

Closes #770 from ewencp/kafka-3080-system-test-console-consumer-version-failure


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

Branch: refs/heads/trunk
Commit: 9577dc2358f4324de04219c7160a10c230a130b9
Parents: 79cda04
Author: Ewen Cheslack-Postava <me...@ewencp.org>
Authored: Thu Jan 21 11:18:24 2016 -0800
Committer: Gwen Shapira <cs...@gmail.com>
Committed: Thu Jan 21 11:18:24 2016 -0800

----------------------------------------------------------------------
 tests/kafkatest/services/console_consumer.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/9577dc23/tests/kafkatest/services/console_consumer.py
----------------------------------------------------------------------
diff --git a/tests/kafkatest/services/console_consumer.py b/tests/kafkatest/services/console_consumer.py
index 4df42b7..2124fc4 100644
--- a/tests/kafkatest/services/console_consumer.py
+++ b/tests/kafkatest/services/console_consumer.py
@@ -135,7 +135,6 @@ class ConsoleConsumer(JmxMixin, BackgroundThreadService):
         self.messages_consumed = {idx: [] for idx in range(1, num_nodes + 1)}
         self.client_id = client_id
         self.print_key = print_key
-        self.log_values = True if version == TRUNK else False
         self.log_level = "TRACE"
 
     def prop_file(self, node):
@@ -192,7 +191,8 @@ class ConsoleConsumer(JmxMixin, BackgroundThreadService):
         if self.print_key:
             cmd += " --property print.key=true"
 
-        if self.log_values:
+        # LoggingMessageFormatter was introduced in 0.9.0.0
+        if node.version > LATEST_0_8_2:
             cmd+=" --formatter kafka.tools.LoggingMessageFormatter"
 
         cmd += " 2>> %(stderr)s | tee -a %(stdout)s &" % args