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

Test result trend breaks lazy-loading

    Details

    • Similar Issues:

      Description

      Setup is the same as in JENKINS-23945 except use the testng branch of the sample project, and configure the TestNG plugin's publisher with **/target/surefire-reports/testng-results.xml. Even with the fix of JENKINS-23945 applied to Jenkins core, after displaying the job index page all builds are loaded:

      ... FINER hudson.model.Run
      reload lazy-load-perf #71 @...
      ... FINEST hudson.model.RunMap
      Loaded lazy-load-perf #71
      hudson.model.RunMap$ThisIsHowItsLoaded
      	at hudson.model.RunMap.retrieve(RunMap.java:221)
      	at hudson.model.RunMap.retrieve(RunMap.java:56)
      	at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:688)
      	at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:650)
      	at jenkins.model.lazy.AbstractLazyLoadRunMap.search(AbstractLazyLoadRunMap.java:382)
      	at jenkins.model.lazy.LazyLoadRunMapEntrySet$1.next(LazyLoadRunMapEntrySet.java:70)
      	at jenkins.model.lazy.LazyLoadRunMapEntrySet$1.next(LazyLoadRunMapEntrySet.java:59)
      	at java.util.AbstractMap$2$1.next(AbstractMap.java:385)
      	at hudson.util.RunList.size(RunList.java:108)
      	at hudson.plugins.testng.TestNGProjectAction.newGraphNotNeeded(TestNGProjectAction.java:141)
      	at hudson.plugins.testng.TestNGProjectAction.doGraph(TestNGProjectAction.java:114)
      	at ...
      

      The problem is TestNGProjectAction.newGraphNotNeeded calling RunList.size, which is deprecated since it forces all builds to be loaded immediately.

        Attachments

          Issue Links

            Activity

            Hide
            nullin Nalin Makar added a comment -

            Jesse,

            What would be the pros/cons of just doing something similar to MethodResult.populateDataSetBuilder and loading the last 10 builds to generate the trend graph?

            Show
            nullin Nalin Makar added a comment - Jesse, What would be the pros/cons of just doing something similar to MethodResult.populateDataSetBuilder and loading the last 10 builds to generate the trend graph?
            Hide
            jglick Jesse Glick added a comment -

            You could use only the last 10 builds, though this would give less a useful graph: you might as well display information for builds you have at hand. The only “pro” I can think of is that the behavior is more consistent because it would always be showing the last 10 (or however many) builds regardless of what Jenkins had been doing before.

            Note that the build history widget loads the most recent 30 builds when you view the job index page, so these would usually be in memory anyway.

            The JENKINS-23945 fix, for JUnit results, is to display the trend for loaded builds. (More precisely, for all builds starting with the most recent and continuing backwards so long as they exist on disk and are loaded in memory.)

            Show
            jglick Jesse Glick added a comment - You could use only the last 10 builds, though this would give less a useful graph: you might as well display information for builds you have at hand. The only “pro” I can think of is that the behavior is more consistent because it would always be showing the last 10 (or however many) builds regardless of what Jenkins had been doing before. Note that the build history widget loads the most recent 30 builds when you view the job index page, so these would usually be in memory anyway. The JENKINS-23945 fix, for JUnit results, is to display the trend for loaded builds. (More precisely, for all builds starting with the most recent and continuing backwards so long as they exist on disk and are loaded in memory.)
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/hudson/plugins/testng/TestNGProjectAction.java
            http://jenkins-ci.org/commit/testng-plugin-plugin/feddedd3e7fa00c22cb7950661380c8f1520c5e6
            Log:
            [FIXED JENKINS-24176] Avoid loading builds from disk just to display test result trend.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/hudson/plugins/testng/TestNGProjectAction.java http://jenkins-ci.org/commit/testng-plugin-plugin/feddedd3e7fa00c22cb7950661380c8f1520c5e6 Log: [FIXED JENKINS-24176] Avoid loading builds from disk just to display test result trend.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Nalin Makar
            Path:
            src/main/java/hudson/plugins/testng/TestNGProjectAction.java
            http://jenkins-ci.org/commit/testng-plugin-plugin/04fbebb13fba94bb40f695dd807908a81d19bb6a
            Log:
            Merge branch 'JENKINS-24176lazy-load' of https://github.com/jglick/testng-plugin-plugin into jglickJENKINS-24176-lazy-load

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nalin Makar Path: src/main/java/hudson/plugins/testng/TestNGProjectAction.java http://jenkins-ci.org/commit/testng-plugin-plugin/04fbebb13fba94bb40f695dd807908a81d19bb6a Log: Merge branch ' JENKINS-24176 lazy-load' of https://github.com/jglick/testng-plugin-plugin into jglick JENKINS-24176 -lazy-load
            Hide
            nullin Nalin Makar added a comment -

            Thanks for the information. I have merged the pull request and will do a release sometime today.

            Show
            nullin Nalin Makar added a comment - Thanks for the information. I have merged the pull request and will do a release sometime today.

              People

              • Assignee:
                nullin Nalin Makar
                Reporter:
                jglick Jesse Glick
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: