Browse Source

MINOR: Set min isr to avoid race condition in ReplicationBytesIn initialisation

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

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>

Closes #3033 from ijuma/fix-transient-test-failure-in-test-broker-topic-metrics-bytes-in-out
pull/3033/merge
Ismael Juma 8 years ago
parent
commit
766dea94e4
  1. 5
      core/src/test/scala/unit/kafka/metrics/MetricsTest.scala

5
core/src/test/scala/unit/kafka/metrics/MetricsTest.scala

@ -34,6 +34,7 @@ import scala.collection._ @@ -34,6 +34,7 @@ import scala.collection._
import scala.collection.JavaConverters._
import scala.util.matching.Regex
import kafka.consumer.{ConsumerConfig, ZookeeperConsumerConnector}
import kafka.log.LogConfig
class MetricsTest extends KafkaServerTestHarness with Logging {
val numNodes = 2
@ -113,7 +114,9 @@ class MetricsTest extends KafkaServerTestHarness with Logging { @@ -113,7 +114,9 @@ class MetricsTest extends KafkaServerTestHarness with Logging {
val bytesIn = s"${BrokerTopicStats.BytesInPerSec},topic=$topic"
val bytesOut = s"${BrokerTopicStats.BytesOutPerSec},topic=$topic"
createTopic(zkUtils, topic, 1, numNodes, servers)
val topicConfig = new Properties()
topicConfig.setProperty(LogConfig.MinInSyncReplicasProp, "2")
createTopic(zkUtils, topic, 1, numNodes, servers, topicConfig)
// Produce a few messages to create the metrics
TestUtils.produceMessages(servers, topic, nMessages)

Loading…
Cancel
Save