kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject kafka git commit: MINOR: Fix replica_verification_tool.py to handle slight change in output format
Date Mon, 18 Sep 2017 14:49:55 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk bd83ae6ba -> 52d7b6763


MINOR: Fix replica_verification_tool.py to handle slight change in output format

The string representation of TopicPartition was changed to be
{topic}-{partitition} consistently in the following commit:

f6f56a645bb1c5ec6810c024ba517e43bf77056c

Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Damian Guy <damian.guy@gmail.com>

Closes #3890 from ijuma/fix-replica-verification-test


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

Branch: refs/heads/trunk
Commit: 52d7b6763b7f8ec1973f1bc399d428542e6e962e
Parents: bd83ae6
Author: Ismael Juma <ismael@juma.me.uk>
Authored: Mon Sep 18 15:49:44 2017 +0100
Committer: Ismael Juma <ismael@juma.me.uk>
Committed: Mon Sep 18 15:49:44 2017 +0100

----------------------------------------------------------------------
 .../test/scala/kafka/tools/ReplicaVerificationToolTest.scala   | 1 +
 tests/kafkatest/services/replica_verification_tool.py          | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/52d7b676/core/src/test/scala/kafka/tools/ReplicaVerificationToolTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/kafka/tools/ReplicaVerificationToolTest.scala b/core/src/test/scala/kafka/tools/ReplicaVerificationToolTest.scala
index eb6142a..211413a 100644
--- a/core/src/test/scala/kafka/tools/ReplicaVerificationToolTest.scala
+++ b/core/src/test/scala/kafka/tools/ReplicaVerificationToolTest.scala
@@ -53,6 +53,7 @@ class ReplicaVerificationToolTest {
     replicaBuffer.verifyCheckSum(line => sb.append(s"$line\n"))
     val output = sb.toString.trim
 
+    // If you change this assertion, you should verify that the replica_verification_test.py
system test still passes
     assertTrue(s"Max lag information should be in output: `$output`",
       output.endsWith(": max lag is 10 for partition a-0 at offset 10 among 3 partitions"))
   }

http://git-wip-us.apache.org/repos/asf/kafka/blob/52d7b676/tests/kafkatest/services/replica_verification_tool.py
----------------------------------------------------------------------
diff --git a/tests/kafkatest/services/replica_verification_tool.py b/tests/kafkatest/services/replica_verification_tool.py
index c65be34..8751797 100644
--- a/tests/kafkatest/services/replica_verification_tool.py
+++ b/tests/kafkatest/services/replica_verification_tool.py
@@ -47,7 +47,7 @@ class ReplicaVerificationTool(KafkaPathResolverMixin, BackgroundThreadService):
         for line in node.account.ssh_capture(cmd):
             self.logger.debug("Parsing line:{}".format(line))
 
-            parsed = re.search('.*max lag is (.+?) for partition \[(.+?)\] at', line)
+            parsed = re.search('.*max lag is (.+?) for partition ([a-zA-Z0-9._-]+-[0-9]+)
at', line)
             if parsed:
                 lag = int(parsed.group(1))
                 topic_partition = parsed.group(2)
@@ -62,9 +62,9 @@ class ReplicaVerificationTool(KafkaPathResolverMixin, BackgroundThreadService):
             topic:          a topic
             partition:      a partition of the topic
         """
-        topic_partition = topic + ',' + str(partition)
+        topic_partition = topic + '-' + str(partition)
         lag = self.partition_lag.get(topic_partition, -1)
-        self.logger.debug("Retuning lag for {} as {}".format(topic_partition, lag))
+        self.logger.debug("Returning lag for {} as {}".format(topic_partition, lag))
 
         return lag
 


Mime
View raw message