kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gwens...@apache.org
Subject [42/50] [abbrv] kafka git commit: MINOR: improve logging of consumer system tests
Date Mon, 11 Apr 2016 23:09:58 GMT
MINOR: improve logging of consumer system tests

Author: Jason Gustafson <jason@confluent.io>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1199 from hachikuji/improve-consumer-systests


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

Branch: refs/heads/0.10.0
Commit: cbdd70ec0de4b4d6d04b62580a5a67ea69311c4a
Parents: 4d467c2
Author: Jason Gustafson <jason@confluent.io>
Authored: Fri Apr 8 10:04:46 2016 -0700
Committer: Ewen Cheslack-Postava <me@ewencp.org>
Committed: Fri Apr 8 10:04:46 2016 -0700

----------------------------------------------------------------------
 tests/kafkatest/tests/client/consumer_test.py                 | 6 ++++++
 .../main/java/org/apache/kafka/tools/VerifiableConsumer.java  | 7 +++++++
 2 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/cbdd70ec/tests/kafkatest/tests/client/consumer_test.py
----------------------------------------------------------------------
diff --git a/tests/kafkatest/tests/client/consumer_test.py b/tests/kafkatest/tests/client/consumer_test.py
index 084b19d..534f65c 100644
--- a/tests/kafkatest/tests/client/consumer_test.py
+++ b/tests/kafkatest/tests/client/consumer_test.py
@@ -66,6 +66,12 @@ class OffsetValidationTest(VerifiableConsumerTest):
                 self.await_all_members(consumer)
                 self.await_consumed_messages(consumer)
 
+    def setup_consumer(self, topic, **kwargs):
+        # collect verifiable consumer events since this makes debugging much easier
+        consumer = super(OffsetValidationTest, self).setup_consumer(topic, **kwargs)
+        self.mark_for_collect(consumer, 'verifiable_consumer_stdout')
+        return consumer
+
     def test_broker_rolling_bounce(self):
         """
         Verify correct consumer behavior when the brokers are consecutively restarted.

http://git-wip-us.apache.org/repos/asf/kafka/blob/cbdd70ec/tools/src/main/java/org/apache/kafka/tools/VerifiableConsumer.java
----------------------------------------------------------------------
diff --git a/tools/src/main/java/org/apache/kafka/tools/VerifiableConsumer.java b/tools/src/main/java/org/apache/kafka/tools/VerifiableConsumer.java
index 25b87bd..1880d7a 100644
--- a/tools/src/main/java/org/apache/kafka/tools/VerifiableConsumer.java
+++ b/tools/src/main/java/org/apache/kafka/tools/VerifiableConsumer.java
@@ -256,9 +256,16 @@ public class VerifiableConsumer implements Closeable, OffsetCommitCallback,
Cons
     }
 
     private static abstract class ConsumerEvent {
+        private final long timestamp = System.currentTimeMillis();
+
         @JsonProperty
         public abstract String name();
 
+        @JsonProperty
+        public long timestamp() {
+            return timestamp;
+        }
+
         @JsonProperty("class")
         public String clazz() {
             return VerifiableConsumer.class.getName();


Mime
View raw message