jenkinsci / jenkinsci/workflow-basic-steps-plugin

[JENKINS-64969] catchError with timeout : the build result is always ABORTED whatever the configured buildResult

Open
#518 1 comment 0 reactions 0 assignees View on GitHub
component:workflow-basic-steps-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
73
Forks
129
PR merge metrics
No merged PRs in 30d

Description

Whatever the way catchError is configured, a timeout block ends the build as ABORTED if the timeout fires.

Here is a test case job to reproduce this :

 

@​Library("EvlinkCiLib@​EVL-1262-ci-install-kw-and-cross-compilation-build-chain-for-lms") _pipeline {

agent { label 'buster' }
environment {
pipeName="TimedOut Job"
projectDir='timeout'
}
stages {
stage('timedOut node NOK'){
steps {
timeout(time: 10, unit: 'SECONDS') {
catchError(catchInterruptions: false,message: 'Cannot contact slave',buildResult: 'SUCCESS', stageResult: 'UNSTABLE') {
// This node exists but is not connected
node(label: 'rpi') {
sh('uname -a')
}
}
}
}
}
stage('timedOut node OK'){
// The node 'buster' is OK
steps {
catchError(catchInterruptions: false,message: 'Cannot contact slave',buildResult: 'SUCCESS', stageResult: 'UNSTABLE') {
timeout(time: 10, unit: 'SECONDS') {
node(label: 'buster') {
sh('uname -a')
}
}
}
}
}
}
}

 

---
Originally reported by jielpe_fr38, imported from: catchError with timeout : the build result is always ABORTED whatever the configured buildResult


  • status: Open
  • priority: Major
  • component(s): workflow-basic-steps-plugin
  • resolution: Unresolved
  • votes: 2
  • watchers: 4
  • imported: 20251215-220547

Raw content of original issue

Whatever the way catchError is configured, a timeout block ends the build as ABORTED if the timeout fires.
Here is a test case job to reproduce this :

 



@Library("EvlinkCiLib@EVL-1262-ci-install-kw-and-cross-compilation-build-chain-for-lms") _pipeline {

agent { label 'buster' }
environment {
pipeName="TimedOut Job"
projectDir='timeout'
}
stages {
stage('timedOut node NOK'){
steps {
timeout(time: 10, unit: 'SECONDS') {
catchError(catchInterruptions: false,message: 'Cannot contact slave',buildResult: 'SUCCESS', stageResult: 'UNSTABLE') {
// This node exists but is not connected
node(label: 'rpi') {
sh('uname -a')
}
}
}
}
}
stage('timedOut node OK'){
// The node 'buster' is OK
steps {
catchError(catchInterruptions: false,message: 'Cannot contact slave',buildResult: 'SUCCESS', stageResult: 'UNSTABLE') {
timeout(time: 10, unit: 'SECONDS') {
node(label: 'buster') {
sh('uname -a')
}
}
}
}
}
}
}


 

environment

```
Jenkins 2.263.3 on Debian Buster and opnJdk8

pipeline-basic-steps 2.23

pipeline-model-definition 1.8.3
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.