Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-66126

Flaky Test Handler plugin: sometimes flakiness indicator is missing in aggregated test data

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Various Jenkins versions: 2.222.4, 2.284, 2.262.2, 2.277.1
    • Similar Issues:
    • Released As:
      flaky-test-handler-plugin-1.2.0

      Description

      As reported in a comment from Piotr Galar in https://issues.jenkins.io/browse/JENKINS-61263 the weather image and the sentence "x tests flaked among all the passing tests" are not shown in the test results next to the class name and method names.

      After investigation i found out that this issue does not depend on the current result (failed or success). It can also happen on failed test suites, but it seems to be related to one run before having no failures (just a guess).

      It could also be related to https://issues.jenkins.io/browse/JENKINS-34292

       

        Attachments

          Activity

          Hide
          svenjost Sven Jost added a comment -

          Here is the problem: The badge.jelly containing the “x tests flaked among all the passing tests“ information is shown when there is a test action (see https://github.com/jenkinsci/junit-plugin/blob/master/src/main/resources/hudson/tasks/junit/ClassResult/body.jelly#L40 ). To get an action for a test object, the method getTestAction(TestObject testObject) is called in class JUnitFlakyTestData. The class JUnitFlakyTestData contains a map testCaseFlakyInfoMap which should link the testobject id with the action. Unfortunately the saved id is sometimes different from the testobject id that jenkins requests. Instead of junit/com.wire.qa.flakyjunit5test/FlakyTest it is junit/com.wire.qa.flakyjunit5test_2/FlakyTest_2 in the map. I have a feeling the map is not filled correctly but i have currently no clue why the _2 is added. I'm trying to understand why and then work on a fix.

          Show
          svenjost Sven Jost added a comment - Here is the problem: The badge.jelly containing the “x tests flaked among all the passing tests“ information is shown when there is a test action (see https://github.com/jenkinsci/junit-plugin/blob/master/src/main/resources/hudson/tasks/junit/ClassResult/body.jelly#L40 ). To get an action for a test object, the method getTestAction(TestObject testObject) is called in class JUnitFlakyTestData . The class JUnitFlakyTestData contains a map testCaseFlakyInfoMap which should link the testobject id with the action. Unfortunately the saved id is sometimes different from the testobject id that jenkins requests. Instead of junit/com.wire.qa.flakyjunit5test/FlakyTest it is junit/com.wire.qa.flakyjunit5test_2/FlakyTest_2 in the map. I have a feeling the map is not filled correctly but i have currently no clue why the _2 is added. I'm trying to understand why and then work on a fix.
          Hide
          svenjost Sven Jost added a comment -

          PR https://github.com/jenkinsci/flaky-test-handler-plugin/pull/22 with fix is merged and will be released with next version.

          Show
          svenjost Sven Jost added a comment - PR https://github.com/jenkinsci/flaky-test-handler-plugin/pull/22 with fix is merged and will be released with next version.

            People

            Assignee:
            svenjost Sven Jost
            Reporter:
            svenjost Sven Jost
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: