[ 
https://issues.apache.org/jira/browse/KAFKA-16346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

PoAn Yang updated KAFKA-16346:
------------------------------
    Summary: Fix flaky MetricsTest.testMetrics  (was: Fix flay 
MetricsTest.testMetrics)

> Fix flaky MetricsTest.testMetrics
> ---------------------------------
>
>                 Key: KAFKA-16346
>                 URL: https://issues.apache.org/jira/browse/KAFKA-16346
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Chia-Ping Tsai
>            Assignee: PoAn Yang
>            Priority: Minor
>
> {code}
> Gradle Test Run :core:test > Gradle Test Executor 1119 > MetricsTest > 
> testMetrics(boolean) > testMetrics with systemRemoteStorageEnabled: false 
> FAILED
>     org.opentest4j.AssertionFailedError: Broker metric not recorded correctly 
> for 
> kafka.network:type=RequestMetrics,name=MessageConversionsTimeMs,request=Produce
>  value 0.0 ==> expected: <true> but was: <false>
>         at 
> app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
>         at 
> app//org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
>         at 
> app//org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
>         at 
> app//org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
>         at 
> app//org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:214)
>         at 
> app//kafka.api.MetricsTest.verifyBrokerMessageConversionMetrics(MetricsTest.scala:314)
>         at app//kafka.api.MetricsTest.testMetrics(MetricsTest.scala:110)
> {code}
> The value used to update metrics is calculated by Math.round, so it could be 
> zero if you have a good machine :)
> We should verify the `count`  instead of `value`, since it is convincible and 
> more stable.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to