You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by mi...@apache.org on 2024/11/22 19:40:57 UTC
(kafka) branch trunk updated: KAFKA-18000: Fix flaky ReplicaManagerTest#testSuccessfulBuildRemoteLogAuxStateMetrics (#17887)
This is an automated email from the ASF dual-hosted git repository.
mimaison pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new 33318bc0f49 KAFKA-18000: Fix flaky ReplicaManagerTest#testSuccessfulBuildRemoteLogAuxStateMetrics (#17887)
33318bc0f49 is described below
commit 33318bc0f4973b090b1b42dc21ab3ef388af5b91
Author: Mickael Maison <mi...@users.noreply.github.com>
AuthorDate: Fri Nov 22 20:40:51 2024 +0100
KAFKA-18000: Fix flaky ReplicaManagerTest#testSuccessfulBuildRemoteLogAuxStateMetrics (#17887)
Reviewers: David Arthur <mu...@gmail.com>
---
core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala b/core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala
index 5b9b97519b0..1ce3c7de525 100644
--- a/core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala
+++ b/core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala
@@ -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._
@@ -4343,7 +4342,6 @@ class ReplicaManagerTest {
}
}
- @Flaky("KAFKA-18000")
@Test
def testSuccessfulBuildRemoteLogAuxStateMetrics(): Unit = {
val tp0 = new TopicPartition(topic, 0)
@@ -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)