Skip to content

Commit

Permalink
KAFKA-18000: Fix flaky ReplicaManagerTest#testSuccessfulBuildRemoteLo…
Browse files Browse the repository at this point in the history
…gAuxStateMetrics (#17887)


Reviewers: David Arthur <[email protected]>
  • Loading branch information
mimaison authored Nov 22, 2024
1 parent d5e2704 commit 33318bc
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import org.apache.kafka.common.requests.FetchRequest.PartitionData
import org.apache.kafka.common.requests.ProduceResponse.PartitionResponse
import org.apache.kafka.common.requests._
import org.apache.kafka.common.security.auth.KafkaPrincipal
import org.apache.kafka.common.test.api.Flaky
import org.apache.kafka.common.utils.{Exit, LogContext, Time, Utils}
import org.apache.kafka.coordinator.transaction.TransactionLogConfig
import org.apache.kafka.image._
Expand Down Expand Up @@ -4343,7 +4342,6 @@ class ReplicaManagerTest {
}
}

@Flaky("KAFKA-18000")
@Test
def testSuccessfulBuildRemoteLogAuxStateMetrics(): Unit = {
val tp0 = new TopicPartition(topic, 0)
Expand Down Expand Up @@ -4390,10 +4388,12 @@ class ReplicaManagerTest {
replicaManager.becomeLeaderOrFollower(0, leaderAndIsrRequest, (_, _) => ())

// Replicas fetch from the leader periodically, therefore we check that the metric value is increasing
assertTrue(brokerTopicStats.topicStats(tp0.topic()).buildRemoteLogAuxStateRequestRate.count > 0)
waitUntilTrue(() => brokerTopicStats.topicStats(tp0.topic()).buildRemoteLogAuxStateRequestRate.count > 0,
"Should have buildRemoteLogAuxStateRequestRate count > 0, but got:" + brokerTopicStats.topicStats(tp0.topic()).buildRemoteLogAuxStateRequestRate.count)
assertEquals(0, brokerTopicStats.topicStats(tp0.topic()).failedBuildRemoteLogAuxStateRate.count)
// Verify aggregate metrics
assertTrue(brokerTopicStats.allTopicsStats.buildRemoteLogAuxStateRequestRate.count > 0)
waitUntilTrue(() => brokerTopicStats.allTopicsStats.buildRemoteLogAuxStateRequestRate.count > 0,
"Should have all topic buildRemoteLogAuxStateRequestRate count > 0, but got:" + brokerTopicStats.allTopicsStats.buildRemoteLogAuxStateRequestRate.count)
assertEquals(0, brokerTopicStats.allTopicsStats.failedBuildRemoteLogAuxStateRate.count)
} finally {
replicaManager.shutdown(checkpointHW = false)
Expand Down

0 comments on commit 33318bc

Please sign in to comment.