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

Pipeline has failed but its only stage is successful - when using Kyoto

    XMLWordPrintable

Details

    • 1.0-beta-1

    Description

      EDIT (mic): this seems only in Kyoto's config for now (still worth investigating..) - not block scoped stages.

      This pipeline has failed but the stage is reported as successful

      Jenkinsfile example

      pipeline {
          agent docker:'java'
          stages {
              stage ('Build') {
                  sh 'mvn clean source:jar package'
              }
              stage ('Browser Tests') {
                  parallel (
                      'Firefox': {
                          sh "echo 'setting up selenium environment'"
                          sh 'sleep 5000'
                      },
                      'Safari': {
                          sh "echo 'setting up selenium environment'"
                          sh 'sleep 5000'
                      },
                      'Chrome': {
                          sh "echo 'setting up selenium environment'"
                          sh 'sleep 3000'
                      },
                      'Internet Explorer': {
                          sh "echo 'setting up selenium environment'"
                          sh 'sleep 2000'
                      }
                    )
              }
              stage ('Static Analysis') {
                  sh 'mvn findbugs:findbugs'
              }
              stage ('Package') {
                  sh 'mvn source:jar package -Dmaven.test.skip'
              }
          }
      
          postBuild {
              always {
                  junit '**/target/surefire-reports/TEST-*.xml'
                  archive '**/target/*.jar'
              }
          }
      }
      

      Attachments

        Activity

          michaelneale Michael Neale added a comment - - edited

          I did some digging. The good news is with block scoped stages it seems ok.

          I reduced it to:

          {noscript}

          node {
          stage ('Build') { sh 'mvn clean source:jar package' }
          stage ('Browser Tests') {
          parallel (
          'Firefox': { sh "echo 'setting up selenium environment'" sh 'sleep 5000' },
          'Safari': { sh "echo 'setting up selenium environment'" sh 'sleep 5000' },
          'Chrome': { sh "echo 'setting up selenium environment'" sh 'sleep 3000' },
          'Internet Explorer': { sh "echo 'setting up selenium environment'" sh 'sleep 2000' }
          )
          }
          }
          {noscript}

          and it seems fine. Same if you change it to non block scoped stages.

          Pipeline-model doesn't use block scoped yet.

          So this only happens with pipeline-model (Kyoto) syntax, so I think worth investigating. If this is showing up incorrect stage state, there is likely all sorts of other problems.

          michaelneale Michael Neale added a comment - - edited I did some digging. The good news is with block scoped stages it seems ok. I reduced it to: {noscript} node { stage ('Build') { sh 'mvn clean source:jar package' } stage ('Browser Tests') { parallel ( 'Firefox': { sh "echo 'setting up selenium environment'" sh 'sleep 5000' }, 'Safari': { sh "echo 'setting up selenium environment'" sh 'sleep 5000' }, 'Chrome': { sh "echo 'setting up selenium environment'" sh 'sleep 3000' }, 'Internet Explorer': { sh "echo 'setting up selenium environment'" sh 'sleep 2000' } ) } } {noscript} and it seems fine. Same if you change it to non block scoped stages. Pipeline-model doesn't use block scoped yet. So this only happens with pipeline-model (Kyoto) syntax, so I think worth investigating. If this is showing up incorrect stage state, there is likely all sorts of other problems.
          vivek Vivek Pandey added a comment - - edited

          michaelneale I could not run your sample, docker step took for ever. I tried with agent label and I could reproduce it.

          I tried a simpler kyoto script: https://github.com/vivek/hellokyoto/blob/feature/kyoto/Jenkinsfile. It works as expected, that is chrome branch is shown as failing. So I think its working as expected. See attached image .

          So something in stage is not reporting it as broken. stay tuned.

          vivek Vivek Pandey added a comment - - edited michaelneale I could not run your sample, docker step took for ever. I tried with agent label and I could reproduce it. I tried a simpler kyoto script: https://github.com/vivek/hellokyoto/blob/feature/kyoto/Jenkinsfile . It works as expected, that is chrome branch is shown as failing. So I think its working as expected. See attached image . So something in stage is not reporting it as broken. stay tuned.
          jamesdumay James Dumay added a comment -

          Good to know you're on it vivek

          jamesdumay James Dumay added a comment - Good to know you're on it vivek
          michaelneale Michael Neale added a comment -

          vivek it likely is pulling down a docker image - so it will take time depending on the connection.
          Perhaps this is specific to when steps happen in docker...

          There is going to be a new pipeline model release in the next day, so perhaps we can try again then.

          michaelneale Michael Neale added a comment - vivek it likely is pulling down a docker image - so it will take time depending on the connection. Perhaps this is specific to when steps happen in docker... There is going to be a new pipeline model release in the next day, so perhaps we can try again then.
          vivek Vivek Pandey added a comment -

          Confirmed failures are not propagated correctly with kyoto plugin 0.1. Part of it is due to the fact that there is regression in how kyoto propagates errors to FlowExecution. Opened a ticket https://issues.jenkins-ci.org/browse/JENKINS-38049.

          While it gets fixed, I have a workaround in blueocean branch bug/JENKINS-38012. With this workaround and with latest pipeline-model-definition (0.2-SNAPSHOT) failure propagation in all three types of scripts works well: legacy stage, blocked stage and kyoto style script.

          abayer said 0.2 release is coming out tomorrow, after that we can proceed with integrating and test it.

          vivek Vivek Pandey added a comment - Confirmed failures are not propagated correctly with kyoto plugin 0.1. Part of it is due to the fact that there is regression in how kyoto propagates errors to FlowExecution. Opened a ticket https://issues.jenkins-ci.org/browse/JENKINS-38049 . While it gets fixed, I have a workaround in blueocean branch bug/ JENKINS-38012 . With this workaround and with latest pipeline-model-definition (0.2-SNAPSHOT) failure propagation in all three types of scripts works well: legacy stage, blocked stage and kyoto style script. abayer said 0.2 release is coming out tomorrow, after that we can proceed with integrating and test it.

          People

            vivek Vivek Pandey
            jamesdumay James Dumay
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: