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:

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

              Created:
              Updated: