Skip to content

Commit

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


Reviewers: David Arthur <[email protected]>
  • Loading branch information
mimaison authored and chiacyu committed Nov 30, 2024
1 parent 0a57e85 commit 918ab3e
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 918ab3e

Please sign in to comment.