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

Steps from post actions are not visible when used with parallel stages

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • blueocean-plugin

      I'm using declarative pipeline and the steps from the post actions are not visible when there are parallel stages inside stages directive, but they are shown when there are only sequential stages in jenkinsfile. The actions from post are executed because I can see them in the log file, but the steps are simply not visible. You can see from the following 2 jenkinsfiles that only in the 2nd one the echo "hi from post" step is visible

      1) This jenkinsfile is not working properly (uses parallel stages) (see attachment log-parallel.txt for logs):

      pipeline {
        agent none
      
        stages {
          stage('Parallel Stages') {
            parallel {
              stage('Stage 1') {
                steps {
                  node(label: 'ec2_node_bigger') {
                    sh 'echo "hi from 1"'
                  }
                }
              }
      
              stage('Stage 2') {
                steps {
                  node(label: 'ec2_node_bigger') {
                    sh 'echo "hi from 2"'
                  }
                }
              }
      
            }
      
          }
          
        }
      
        post {
          always {
            node(label: 'ec2_node_bigger') {
              sh 'echo "hi from post"'
            }
          }
        }
      
      }
      

      Screenshot from blue ocean interface:

      2) This jenkinsfile is working as expected (does not use parallel stages) (see attachment log-sequential.txt for logs):

      pipeline {
        agent none
      
        stages {
          stage('Stage 1') {
            steps {
              node(label: 'ec2_node_bigger') {
                sh 'echo "hi from 1"'
              }
            }
          }
      
          stage('Stage 2') {
            steps {
              node(label: 'ec2_node_bigger') {
                sh 'echo "hi from 2"'
              }
            }
          }
      
        }
      
        post {
          always {
            node(label: 'ec2_node_bigger') {
              sh 'echo "hi from post"'
            }
          }
        }
      
      }
      

      Screenshot from blue ocean interface:

        1. image-2019-08-07-17-51-34-871.png
          47 kB
          Alex Buicescu
        2. image-2019-08-07-17-51-57-772.png
          46 kB
          Alex Buicescu
        3. log-parallel.txt
          1 kB
          Alex Buicescu
        4. log-sequential.txt
          1 kB
          Alex Buicescu

            Unassigned Unassigned
            alexbuicescu Alex Buicescu
            Votes:
            5 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: