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

Warning log spam "[hudson.tasks.junit.CaseResult getRun] In getOwner(), suiteResult.getParent() is null."

    XMLWordPrintable

Details

    Description

      After upgrading Jenkins plugins (presumably irrelevant durable-task => 1.16): junit 1.21 => 1.22.1

      ***@***:~$ grep "In getOwner" /var/log/jenkins/jenkins.log
      ...
      2017-11-15 10:54:05 WARNING [hudson.tasks.junit.CaseResult getRun]   In getOwner(), suiteResult.getParent() is null.
      ***@***:~$ grep "In getOwner" /var/log/jenkins/jenkins.log | wc -l
      820
      

       

      Actually I had hoped to benefit from JENKINS-27395 (due to having two different stages using the junit step for recording the test results), but in fact everything looks like before, except the new excessive warning log spam. Since the number of tests is in fact 678, I am also wondering about the number of 820 logs.

      The junit step is called like this: junit(keepLongStdio: true, testResults: phpUnitXmlFilename); as aforementioned in two different stages for different XML Files, each one stemming from PHPUnit 6.4.3

      Attachments

        Issue Links

          Activity

            OK, now I got it, thanks for your patience; and I can actually see/confirm that ("shown for individual tests")

            Just out of interest: are there any plans to pimp the visualization and not merge all test results together, but – frankly I don't know what the best UX would be – have one TestResult tab/entry per run or stage or so?

             

            reinholdfuereder Reinhold Füreder added a comment - OK, now I got it, thanks for your patience; and I can actually see/confirm that ("shown for individual tests") Just out of interest: are there any plans to pimp the visualization and not merge all test results together, but – frankly I don't know what the best UX would be – have one TestResult tab/entry per run or stage or so?  
            abayer Andrew Bayer added a comment -

            Maaaaybe? That's definitely on the roadmap for Blue Ocean, and I'll see if I can figure out something that makes sense for classic UI as well.

            abayer Andrew Bayer added a comment - Maaaaybe? That's definitely on the roadmap for Blue Ocean, and I'll see if I can figure out something that makes sense for classic UI as well.
            abayer Andrew Bayer added a comment -

            Releasing 1.22.2 with this fix right now.

            abayer Andrew Bayer added a comment - Releasing 1.22.2 with this fix right now.

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            src/main/java/hudson/tasks/junit/CaseResult.java
            src/main/java/hudson/tasks/junit/SuiteResult.java
            src/test/java/hudson/tasks/junit/pipeline/JUnitResultsStepTest.java
            http://jenkins-ci.org/commit/junit-plugin/9ec93955137b9eeba7715e6f118e558be7dbb712
            Log:
            [FIXED JENKINS-48020] Show stage in failed tests, fix warnings

            First, this changes `CaseResult#getFullDisplayName()` to include
            stage/branch names like `CaseResult#getDisplayName()`, so that the
            full information will show up in lists of failed tests, for example.

            Second, stop using `CaseResult#getDisplayName()` for indexing
            `CaseResult`s in `SuiteResult`. That method will spam warnings if
            called too early in the run now due to `CaseResult#getRun()` being
            called before the `SuiteResult`'s parent is set.

            Third, fix `JUnitResultsStepTest#testTrends` to actually test what
            it's supposed to, to fail if it doesn't find the expected display
            names, to test full display names as well, and to use the same
            filename for the test results each time due to one of the stages' test
            file not containing an explicit suite name, leading to its suite's
            name being set to the filename, breaking `SuiteResult#getPreviousResult()`.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/main/java/hudson/tasks/junit/CaseResult.java src/main/java/hudson/tasks/junit/SuiteResult.java src/test/java/hudson/tasks/junit/pipeline/JUnitResultsStepTest.java http://jenkins-ci.org/commit/junit-plugin/9ec93955137b9eeba7715e6f118e558be7dbb712 Log: [FIXED JENKINS-48020] Show stage in failed tests, fix warnings First, this changes `CaseResult#getFullDisplayName()` to include stage/branch names like `CaseResult#getDisplayName()`, so that the full information will show up in lists of failed tests, for example. Second, stop using `CaseResult#getDisplayName()` for indexing `CaseResult`s in `SuiteResult`. That method will spam warnings if called too early in the run now due to `CaseResult#getRun()` being called before the `SuiteResult`'s parent is set. Third, fix `JUnitResultsStepTest#testTrends` to actually test what it's supposed to, to fail if it doesn't find the expected display names, to test full display names as well, and to use the same filename for the test results each time due to one of the stages' test file not containing an explicit suite name, leading to its suite's name being set to the filename, breaking `SuiteResult#getPreviousResult()`.

            Thanks a lot for the quick fixes => looks good to me (at a first quick glance)

            reinholdfuereder Reinhold Füreder added a comment - Thanks a lot for the quick fixes => looks good to me (at a first quick glance)

            People

              abayer Andrew Bayer
              reinholdfuereder Reinhold Füreder
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: