Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-7266

Fix MetricsTest test flakiness

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.1.0, 2.2.0
    • None
    • None

    Description

      The test `kafka.api.MetricsTest.testMetrics` has been failing intermittently in kafka builds (recent proof: https://github.com/apache/kafka/pull/5436#issuecomment-409683955)
      The particular failure is in the `MessageConversionsTimeMs` metric assertion -

      java.lang.AssertionError: Message conversion time not recorded 0.0
      

      There has been work done previously (https://github.com/apache/kafka/pull/4681) to combat the flakiness of the test and while it has improved it, the test still fails sometimes.

      Solution

      On my machine, the test failed 5 times out of 25 runs. Increasing the record size and using compression should slow down message conversion enough to have it be above 1ms. Locally this test has not failed in 200 runs and counting with those changes

      Attachments

        Issue Links

          Activity

            People

              enether Stanislav Kozlovski
              enether Stanislav Kozlovski
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: