Skip to content

Conversation

@jglick
Copy link
Member

@jglick jglick commented Apr 24, 2024

Otherwise it can be confusing why a build had the result that it did. Observed in a pipeline using the idiom

retry(count: 2, conditions: [kubernetesAgent(), nonresumable()]) {
  node(POD_LABEL) {
    stage('build') {
      withMockLoad(averageDuration: 180) {
        catchError(buildResult: 'UNSTABLE') {
          sh MOCK_LOAD_COMMAND
        }
      }
    }
    stage('publish') {
      junit 'mock-junit.xml'
      archiveArtifacts artifacts: 'mock-artifact-*.txt', allowEmptyArchive: true, fingerprint: true
    }
  }
}

When the first pod is killed, the node block retried and the build ran to completion (FlowEndNode set to SUCCESS) yet the Run is set to UNSTABLE, which is what the step is supposed to do but unintentional here; the reason for the catchError was rather to work around an exit code of 1 from the mock load command due to mock test failures, which is better handled via jenkinsci/mock-load-builder-plugin#102.

@jglick jglick requested a review from a team as a code owner April 24, 2024 19:36
dwnusbaum
dwnusbaum previously approved these changes Apr 25, 2024
@jglick jglick enabled auto-merge April 26, 2024 11:23
@jglick jglick merged commit cbfc1e3 into jenkinsci:master Apr 26, 2024
@jglick jglick deleted the catchError branch May 7, 2024 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants