All stages show up as UNSTABLE when only one stage should / JENKINS-39203

519 views
Skip to first unread message

georg....@netcentric.biz

unread,
Nov 7, 2018, 3:57:08 AM11/7/18
to Jenkins Developers
Hi all,

I eventually had the time to look closer into what is happening under the hood for JENKINS-39203. I found a solution that does not require a code change [1]. For people that maintain a pipeline lib, it is easy to introduce it (if you write this directly in the Jenkinsfile it gets a bit clunky). 

I would like to comment this directly in JENKINS-39203, but for some reason it looks like my account is not allowed to comment or create tickets anymore (that's why I'm writing here). Could I get access with my user ghenzler so I can comment this to the ticket? (I think the 132 people that voted for it might not all read this message)

Thanks & Best Regards
Georg

[1]

Pipeline: 

stage('Build') { }     
for(int i=1; i<=7; i++) {
    try{ 
        stage('Test Suite '+i) { 
            if(Math.floor(Math.random() * 3) % 3 == 0) {
                throw new RuntimeException("tests failed, you would use a custom exception type here")
            } else {
            }
        }
    } catch(err) { currentBuild.result = 'UNSTABLE' }    
}

Result: 
(note that all boxes show up as UNSTABLE because the build is unstable, but the stages that have actually failed are marked as failed)

example-on-how-to-mark-unstable-stages-as-visually-failed-in-stage-overview.png




georg....@netcentric.biz

unread,
Nov 7, 2018, 12:13:24 PM11/7/18
to Jenkins Developers
Reply all
Reply to author
Forward
0 new messages