GitHub user rajinisivaram opened a pull request: https://github.com/apache/kafka/pull/3991
KAFKA-5968: Create/remove request metrics during broker startup/shutdown Replaces the static `RequestMetrics` object with a class so that metrics are created and removed during broker startup and shutdown to avoid metrics tests being affected by metrics left behind by previous tests. Also reinstates `kafka.api.MetricsTest` which was failing frequently earlier due to tests removing the static request metrics. You can merge this pull request into a Git repository by running: $ git pull https://github.com/rajinisivaram/kafka KAFKA-5968 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/3991.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3991 ---- commit ee50940631bc387223045a21a1ded689e15852fb Author: Rajini Sivaram <rajinisiva...@googlemail.com> Date: 2017-09-29T10:27:22Z KAFKA-5968: Create/remove request metrics during broker startup/shutdown ---- ---