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

Trend counts only first reports in Pipeline Job with parallel nodes


    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Duplicate
    • Component/s: junit-plugin, pipeline
    • Labels:
    • Environment:
      Jenkins 2.19.2, JUnit 1.19
    • Similar Issues:


      I have a Pipeline Job with parallel test executions, where every node executor submits own junit reports (obviously, because they are in different workspaces, it's hard to collect reports to one place).

      First of all, it takes some time (up to 5 minutes) even after job is finished to collect/reflect reports on job's test reports page (:job_name/:build_number/testReport/). Rarely, it doesn't track report from some parallel job.

      And it shows wrong (less) tests number on job's test result trend chart. Every build it shows different random number, however they are builds for the same revision.

      My suggestion, is that Trend Test Result chart get's generated before all test results are collected.
      Probably it's a consequence of asynchronous job test result collection, where it collects all reports even after job is finished.

      My approximate workflow is:

        node {
          stage('Preparation') {
            checkout scm
            stash 'workspace'
        stage('Run Tests') {
          def splits = splitTests parallelism: count(workersCount), generateInclusions: true
          def testGroups = [:]
          for (int i = 0; i < splits.size(); i++) {
            def index = i;
            def split = splits[index]
            node {
              //may be different workspace, so unstash
              unstash 'workspace'
              try { 
                sh 'run_tests_here.sh'
              } finally {
                junit 'log/reports/*.xml'
                // clean reports, because next thread may be executed in the same workspace
                sh 'rm -f log/reports/*' 

      P.S. Probably my approach is wrong and I'd love to hear any suggestions.
      My job can run in parallel within the same workspace, but `node` step dedicates new workspace automatically + nodes may be on different machines, so gathering test reports afterward is even harder.


          Issue Links



              • Assignee:
                kukunin Sergiy Kukunin
              • Votes:
                0 Vote for this issue
                4 Start watching this issue


                • Created: