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

Pipeline hangs on JUnitResultArchiver step with test publishers

      This occurs both in parallel and in sequential runs.

      stage 'Unit tests'
      node {
          sh './tools/test/run_unit_tests.sh'
          step([$class: 'JUnitResultArchiver', allowEmptyResults: true, testDataPublishers: [[$class: 'StabilityTestDataPublisher']], testResults: '**/reports/junit-unit.xml'])
      }
      

      when executing following stage/step it hangs with last messages:

      [Pipeline] stage (Unit tests)
      Entering stage Unit tests
      Proceeding
      [Pipeline] node
      Running on мастер in /var/lib/jenkins/home/jobs/project/branches/master/workspace
      [Pipeline] {
      [Pipeline] sh
      [workspace] Running shell script
      + ./tools/test/run_unit_tests.sh
      Starting backend unit tests
      ============================= test session starts ==============================
      platform linux -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
      rootdir: /var/lib/jenkins/home/jobs/project/branches/master/workspace, inifile: 
      plugins: asyncio-0.4.1, cov-2.3.0, mock-1.1
      collected 2 items
      
      src/tests/unit/magic.py ..
      
       generated xml file: /var/lib/jenkins/home/jobs/project/branches/master/workspace/reports/junit-unit.xml 
      
      ----------- coverage: platform linux, python 3.5.2-final-0 -----------
      Coverage XML written to file reports/coverage-unit.xml
      
      =========================== 2 passed in 0.31 seconds ===========================
      Finished backend unit tests
      [Pipeline] step
      Recording test results
      

      after that spinner spins forever

          [JENKINS-36956] Pipeline hangs on JUnitResultArchiver step with test publishers

          Oleg Korsak created issue -
          Oleg Korsak made changes -
          Description Original: This occurs both in parallel and in sequential runs.

          {code:groovy}
          stage 'Unit tests'
          node {
              sh './tools/test/run_unit_tests.sh'
              step([$class: 'JUnitResultArchiver', allowEmptyResults: true, testDataPublishers: [[$class: 'StabilityTestDataPublisher']], testResults: '**/reports/junit-unit.xml'])
          }
          {code}
          when executing following stage/step it hangs with last messages:


          {noformat}
          [Pipeline] stage (Unit tests)
          Entering stage Unit tests
          Proceeding
          [Pipeline] node
          Running on мастер in /var/lib/jenkins/home/jobs/project/branches/master/workspace
          [Pipeline] {
          [Pipeline] sh
          [workspace] Running shell script
          + ./tools/test/run_unit_tests.sh
          Starting backend unit tests
          ============================= test session starts ==============================
          platform linux -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
          rootdir: /var/lib/jenkins/home/jobs/project/branches/master/workspace, inifile:
          plugins: asyncio-0.4.1, cov-2.3.0, mock-1.1
          collected 2 items

          src/tests/unit/magic.py ..

           generated xml file: /var/lib/jenkins/home/jobs/project/branches/master/workspace/reports/junit-unit.xml

          ----------- coverage: platform linux, python 3.5.2-final-0 -----------
          Coverage XML written to file reports/coverage-unit.xml

          =========================== 2 passed in 0.31 seconds ===========================
          Finished backend unit tests
          [Pipeline] step
          Recording test results
          {noformat}

          after that spinner spins forever
          New: This occurs both in parallel and in sequential runs.

          {code:java}
          stage 'Unit tests'
          node {
              sh './tools/test/run_unit_tests.sh'
              step([$class: 'JUnitResultArchiver', allowEmptyResults: true, testDataPublishers: [[$class: 'StabilityTestDataPublisher']], testResults: '**/reports/junit-unit.xml'])
          }
          {code}
          when executing following stage/step it hangs with last messages:


          {noformat}
          [Pipeline] stage (Unit tests)
          Entering stage Unit tests
          Proceeding
          [Pipeline] node
          Running on мастер in /var/lib/jenkins/home/jobs/project/branches/master/workspace
          [Pipeline] {
          [Pipeline] sh
          [workspace] Running shell script
          + ./tools/test/run_unit_tests.sh
          Starting backend unit tests
          ============================= test session starts ==============================
          platform linux -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
          rootdir: /var/lib/jenkins/home/jobs/project/branches/master/workspace, inifile:
          plugins: asyncio-0.4.1, cov-2.3.0, mock-1.1
          collected 2 items

          src/tests/unit/magic.py ..

           generated xml file: /var/lib/jenkins/home/jobs/project/branches/master/workspace/reports/junit-unit.xml

          ----------- coverage: platform linux, python 3.5.2-final-0 -----------
          Coverage XML written to file reports/coverage-unit.xml

          =========================== 2 passed in 0.31 seconds ===========================
          Finished backend unit tests
          [Pipeline] step
          Recording test results
          {noformat}

          after that spinner spins forever

          Daniel Sobral added a comment -

          It stops hanging if you remove test stability.

          Daniel Sobral added a comment - It stops hanging if you remove test stability.

          Oleg Korsak added a comment -

          Yeah, but still this is a code from jenkins sample snippets. And actually removing functionality is not a FIX

          Oleg Korsak added a comment - Yeah, but still this is a code from jenkins sample snippets. And actually removing functionality is not a FIX
          James Dumay made changes -
          Component/s New: workflow-plugin [ 18820 ]
          Component/s Original: pipeline-stage-view-plugin [ 21139 ]
          Component/s Original: pipeline-utility-steps-plugin [ 21135 ]
          Component/s Original: pipeline-view-plugin [ 21435 ]

          The following hangs for me:

          step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml, **/target/failsafe-reports/TEST-*.xml'])
          

          Jenkins ver 2.10
          Pipeline / Pipeline: Build Step ver 2.2

          Michael Scharp added a comment - The following hangs for me: step([$class: 'JUnitResultArchiver' , testResults: '**/target/surefire-reports/TEST-*.xml, **/target/failsafe-reports/TEST-*.xml' ]) Jenkins ver 2.10 Pipeline / Pipeline: Build Step ver 2.2
          Andrew Bayer made changes -
          Component/s New: pipeline-general [ 21692 ]
          Andrew Bayer made changes -
          Component/s Original: workflow-plugin [ 18820 ]

          Edward Easton added a comment - - edited

          I can reproduce this two ways - one using the old syntax and one with the new:

          New Syntax as per the snippet generator - this one hangs:

          stage('stage') {
              node {
                  sh "cp /tmp/junit*.xml ."    //  I have a junit file saved from a previous run here
                  junit testDataPublishers: [[$class: 'ClaimTestDataPublisher']], testResults: '**/junit*.xml'
              }
          }
          

          Old syntax - this one works OK

          stage('stage') {
              node {
                  sh "cp /tmp/junit*.xml ."    //  I have a junit file saved from a previous run here
                  step([$class: 'JUnitResultArchiver', testResults: '**/junit*.xml'])
              }
          }
          

          Here is the thread dump of the hung execution:

          Thread #6
          	at DSL.step(hudson.tasks.junit.JUnitResultArchiver: running in thread: org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution [#15])
          	at DSL.node(running on cn13)
          	at WorkflowScript.run(WorkflowScript:2)
          	at DSL.stage(Native Method)
          	at WorkflowScript.run(WorkflowScript:1)
          

          Versions:
          Jenkins - 2.7.4
          Pipeline - 2.4
          Pipeline Build Step - 2.2

          Edward Easton added a comment - - edited I can reproduce this two ways - one using the old syntax and one with the new: New Syntax as per the snippet generator - this one hangs: stage( 'stage' ) { node { sh "cp /tmp/junit*.xml ." // I have a junit file saved from a previous run here junit testDataPublishers: [[$class: 'ClaimTestDataPublisher' ]], testResults: '**/junit*.xml' } } Old syntax - this one works OK stage( 'stage' ) { node { sh "cp /tmp/junit*.xml ." // I have a junit file saved from a previous run here step([$class: 'JUnitResultArchiver' , testResults: '**/junit*.xml' ]) } } Here is the thread dump of the hung execution: Thread #6 at DSL.step(hudson.tasks.junit.JUnitResultArchiver: running in thread: org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution [#15]) at DSL.node(running on cn13) at WorkflowScript.run(WorkflowScript:2) at DSL.stage(Native Method) at WorkflowScript.run(WorkflowScript:1) Versions: Jenkins - 2.7.4 Pipeline - 2.4 Pipeline Build Step - 2.2

          I'm experiencing the same behavior as Edward here above.

             stage('Results') {
                junit '**/target/surefire-reports/TEST-*.xml'  // --> WORKS FINE
          
                junit testDataPublishers: [[$class: 'ClaimTestDataPublisher']], testResults: '**/target/surefire-reports/TEST-*.xml'  // --> HANGS
             }
          

          Thread dump:

          Thread #8
          	at DSL.step(hudson.tasks.junit.JUnitResultArchiver: running in thread: org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution [#13])
          	at WorkflowScript.run(WorkflowScript:20)
          	at DSL.stage(Native Method)
          	at WorkflowScript.run(WorkflowScript:19)
          	at DSL.node(running on )
          	at WorkflowScript.run(WorkflowScript:1)
          

          Richard Kettelerij added a comment - I'm experiencing the same behavior as Edward here above. stage( 'Results' ) { junit '**/target/surefire-reports/TEST-*.xml' // --> WORKS FINE junit testDataPublishers: [[$class: 'ClaimTestDataPublisher' ]], testResults: '**/target/surefire-reports/TEST-*.xml' // --> HANGS } Thread dump: Thread #8 at DSL.step(hudson.tasks.junit.JUnitResultArchiver: running in thread: org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution [#13]) at WorkflowScript.run(WorkflowScript:20) at DSL.stage(Native Method) at WorkflowScript.run(WorkflowScript:19) at DSL.node(running on ) at WorkflowScript.run(WorkflowScript:1)

            Unassigned Unassigned
            kamikaze Oleg Korsak
            Votes:
            9 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated: