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

last step in finally block incorrectly reported as failed

    XMLWordPrintable

Details

    Description

      Pipeline will incorrectly report that the last step in a finally block has failed if an exception is thrown in the try block. This may cause a developer unnessicary debugging time trying to identify why a step is failing. Eg.

      try {
          error "oops"
      } finally {
          echo "bar"
      }
      

      Results in the echo step being reported as failed.

      Attachments

        Issue Links

          Activity

            Jenkins version 2.332.3 - the bug is still there.
            Looking directly at the workflow folder you can see that there is ErrorAction attached to the EchoStep flownode.

            $ ls -1 | sort -V | xargs -I {} sh -c "xmllint --nowarning --xpath '//Tag/node/id | //Tag/node/descriptorId | //Tag/actions/wf.a.ErrorAction/error/detailMessage' {} | strings"
            <id>2</id>
            <id>3</id><descriptorId>org.jenkinsci.plugins.workflow.steps.ErrorStep</descriptorId><detailMessage>oops</detailMessage>
            <id>4</id><descriptorId>org.jenkinsci.plugins.workflow.steps.EchoStep</descriptorId><detailMessage>oops</detailMessage>
            <id>5</id><detailMessage>oops</detailMessage>
            
            victor_yousician Victor Balakine added a comment - Jenkins version 2.332.3 - the bug is still there. Looking directly at the workflow folder you can see that there is ErrorAction attached to the EchoStep flownode. $ ls -1 | sort -V | xargs -I {} sh -c "xmllint --nowarning --xpath '//Tag/node/id | //Tag/node/descriptorId | //Tag/actions/wf.a.ErrorAction/error/detailMessage' {} | strings" <id>2</id> <id>3</id><descriptorId>org.jenkinsci.plugins.workflow.steps.ErrorStep</descriptorId><detailMessage>oops</detailMessage> <id>4</id><descriptorId>org.jenkinsci.plugins.workflow.steps.EchoStep</descriptorId><detailMessage>oops</detailMessage> <id>5</id><detailMessage>oops</detailMessage>

            People

              Unassigned Unassigned
              jhoblitt Joshua Hoblitt
              Votes:
              4 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: