You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by gu...@apache.org on 2015/12/21 19:44:19 UTC

kafka git commit: KAFKA-2455: Fix failure in kafka.consumer.MetricsTest.testMetricsLeak

Repository: kafka
Updated Branches:
  refs/heads/trunk d2632d011 -> e32131ed6


KAFKA-2455: Fix failure in kafka.consumer.MetricsTest.testMetricsLeak

DelayedFetchMetrics are loaded dynamically in function "onExpiration";
use assertNull(DelayedFetchMetrics) to initialize DelayedFetchMetrics explicitly;

Author: jinxing <ji...@fenbi.com>
Author: ZoneMayor <ji...@126.com>

Reviewers: Ismael Juma, Guozhang Wang

Closes #694 from ZoneMayor/trunk-KAFKA-2455


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

Branch: refs/heads/trunk
Commit: e32131ed6fcfaea7e56295ea0b6ddbf8c804460f
Parents: d2632d0
Author: Jin Xing <ji...@fenbi.com>
Authored: Mon Dec 21 10:43:46 2015 -0800
Committer: Guozhang Wang <wa...@gmail.com>
Committed: Mon Dec 21 10:43:46 2015 -0800

----------------------------------------------------------------------
 core/src/test/scala/unit/kafka/metrics/MetricsTest.scala | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/e32131ed/core/src/test/scala/unit/kafka/metrics/MetricsTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/unit/kafka/metrics/MetricsTest.scala b/core/src/test/scala/unit/kafka/metrics/MetricsTest.scala
index d699386..ee41fd7 100644
--- a/core/src/test/scala/unit/kafka/metrics/MetricsTest.scala
+++ b/core/src/test/scala/unit/kafka/metrics/MetricsTest.scala
@@ -58,6 +58,9 @@ class MetricsTest extends KafkaServerTestHarness with Logging {
     // force creation not client's specific metrics.
     createAndShutdownStep("group0", "consumer0", "producer0")
 
+    //this assertion is only used for creating the metrics for DelayedFetchMetrics, it should never fail, but should not be removed
+    assertNotNull(DelayedFetchMetrics)
+
     val countOfStaticMetrics = Metrics.defaultRegistry().allMetrics().keySet().size
 
     for (i <- 0 to 5) {