Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-25866

Fix an unit test failure on ambari-metrics-kafka-sink

    XMLWordPrintableJSON

Details

    Description

      I tried to run unit tests on the release-2.0.0-rc0 branch and ran into the following error:

      $ mvn test -f ambari-metrics-kafka-sink/pom.xml
      
      ...
      
      Tests run: 3, Failures: 3, Errors: 0, Skipped: 0, Time elapsed: 1.519 sec <<< FAILURE! - in org.apache.hadoop.metrics2.sink.kafka.KafkaTimelineMetricsReporterTest
      testReporterStartStop(org.apache.hadoop.metrics2.sink.kafka.KafkaTimelineMetricsReporterTest)  Time elapsed: 0.817 sec  <<< FAILURE!
      java.lang.AssertionError: 
      
        Expectation failure on verify:
          Metrics.defaultRegistry(): expected: 2, actual: 0
      	at org.apache.hadoop.metrics2.sink.kafka.KafkaTimelineMetricsReporterTest.testReporterStartStop(KafkaTimelineMetricsReporterTest.java:102)
      
      testReporterStartStopHttps(org.apache.hadoop.metrics2.sink.kafka.KafkaTimelineMetricsReporterTest)  Time elapsed: 0.022 sec  <<< FAILURE!
      java.lang.AssertionError: 
      
        Expectation failure on verify:
          Metrics.defaultRegistry(): expected: 2, actual: 0
      	at org.apache.hadoop.metrics2.sink.kafka.KafkaTimelineMetricsReporterTest.testReporterStartStopHttps(KafkaTimelineMetricsReporterTest.java:131)
      
      testMetricsExclusionPolicy(org.apache.hadoop.metrics2.sink.kafka.KafkaTimelineMetricsReporterTest)  Time elapsed: 0.021 sec  <<< FAILURE!
      java.lang.AssertionError: 
      
        Expectation failure on verify:
          Metrics.defaultRegistry(): expected: 2, actual: 0
      	at org.apache.hadoop.metrics2.sink.kafka.KafkaTimelineMetricsReporterTest.testMetricsExclusionPolicy(KafkaTimelineMetricsReporterTest.java:151)
      
      
      Results :
      
      Failed tests: 
        KafkaTimelineMetricsReporterTest.testMetricsExclusionPolicy:151 
        Expectation failure on verify:
          Metrics.defaultRegistry(): expected: 2, actual: 0
        KafkaTimelineMetricsReporterTest.testReporterStartStop:102 
        Expectation failure on verify:
          Metrics.defaultRegistry(): expected: 2, actual: 0
        KafkaTimelineMetricsReporterTest.testReporterStartStopHttps:131 
        Expectation failure on verify:
          Metrics.defaultRegistry(): expected: 2, actual: 0
      
      Tests run: 5, Failures: 3, Errors: 0, Skipped: 0
      
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  4.238 s
      [INFO] Finished at: 2023-02-24T09:46:44+09:00
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19:test (default-test) on project ambari-metrics-kafka-sink: There are test failures.
      

      Attachments

        Issue Links

          Activity

            People

              wuzhiguo Zhiguo Wu
              sekikn Kengo Seki
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: