-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
Various Jenkins versions: 2.222.4, 2.284, 2.262.2, 2.277.1
-
-
flaky-test-handler-plugin-1.2.0
As reported in a comment from gfjalar 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
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.