Re-start specific failed stage from parallel jenkins pipeline execution

Attached Jenkins file and execution .

If I am executing parallel stage and one of the 3 stage fails then can i only restart the failed specific stage.

in given picture there is a Testing stage and in testing stage there is 3 parallel jobs 1,2 and 3. if job 2 will get failed , can we re-start job 2 again ? instead of executing entire Testing stage again where it will execute all the 3 stages .

Jenkins File 

pipeline {
agent {
    label "agent1"
}
stages {
    stage('Test') {
        parallel {
            stage('Test1') {
                steps { sh 'echo Test 1 passed' }
            }
            stage('Test2') {
                steps {
                    sh 'echo Test2 is passed'
                }
            } stage('Test3') {
                steps {
                    sh 'echo Test 3 passed'
                }
            }
        }
    }
}

Is there any possible way in jenkins to achieve this kind of execution

Declarative Pipeline supports restarting from a failed serial stage—so in this example if you removed parallel and its enclosing stage('Test') then if Test2 failed you could restart from there, rerunning Test2 and Test3. As far as I know there is no support for rerunning only a failed parallel stage (plus, presumably, any serial stages following the parallel block), though I cannot think of any technical reason why such a capability could not be added.

1 Like