Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to make the runner continue with the next srep, if one step inside parallel step fails?

Sena Turku Cakmak August 14, 2024

Hello,

I have a pipeline and every step has a backup step that runs with another runner. If one step in parallel steps fails, I want the other step to still be able to continue without interruption and without the whole pipelie failing itself. For example:

Bild (2).png

In this image there are 2 runners for parallel steps, Main and Backup. If backup runner fails as seen in "Check commit message [Backup]" step, I want the main runner to continue with the "TPT test" step since main runner completed "Check commit message" step successfully.

So basically even if one of the parallel steps fail, if the other was successfull, I want the other step to still continue with the next step rather then stopping after parallel step is done. Is this possible, or is there a workaround?

Thanks for your time,

Sena

2 answers

1 accepted

0 votes
Answer accepted
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 16, 2024

Hi @Sena Turku Cakmak

Thank you for reaching out to the community.

Could you share your Pipelines YAML file but masking any sensitive information?

Regards,
Mark C

Sena Turku Cakmak August 19, 2024
image: atlassian/default-image:4


definitions:
steps:
    - step: &updateDevVersion_run
        name: 'Update development version'
        clone:
            depth: full
        script:
          - echo "Made a change in build ${BITBUCKET_BUILD_NUMBER}"

    - step: &commitCheck_run
        clone:
          enabled : true
        script:
          - echo "checking commits with custom runner"

    - step: &TPT_run
        clone:
          enabled : false
        script:
          - echo "running TPT test in custom runner";  

pipelines:
  branches:
    feature/*:
        - step: *updateDevVersion_run
        - parallel:
            - step:
                #fail-fast: false
                name: 'Check commit message'
                runs-on:
                    - self.hosted
                    - windows
                    - customrunner1
                <<: *commitCheck_run  
            - step:             
                # fail-fast: false 
                name: 'Check commit message [Backup]'
                runs-on:
                    - self.hosted
                    - windows
                    - customrunner2
                <<: *commitCheck_run

        - parallel:
            - step:
                #fail-fast: false
                name: 'TPT test'
                runs-on:
                    - self.hosted
                    - windows
                    - customrunner1
                <<: *TPT_run
            - step:
                # fail-fast: false
                name: 'TPT test [Backup]'
                runs-on:
                    - self.hosted
                    - windows
                    - customrunner2
                <<: *TPT_run          

 Here it is, hope this helps to solve the problem!

Sena Turku Cakmak August 20, 2024

is there any update?

Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 21, 2024

Hi @Sena Turku Cakmak

Thanks for providing your YAML configuration.
I've tested the same on my end, unfortunately, there's no other way to resume builds when one of the parallel steps fails.

Right now, you can either merge those steps into one parallel step or explore the possibility of using after-scripts configuration which will allow you to run a step regardless if a step is successful or not.

Regards,
Mark C

Sena Turku Cakmak August 23, 2024

Hey Mark,

Right now, you can either merge those steps into one parallel step or explore the possibility of using after-scripts configuration which will allow you to run a step regardless if a step is successful or not.

Can you elaborate on how this would look like in my yml file? Thank you for the support.

Best regards,

Sena

Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 26, 2024

Hi @Sena Turku Cakmak

You can essentially use one "parallel" step to run all those 4 steps that you have.

Regarding after-script, you can try this by completely removing the "parallel" configuration and adding after-script to each of your steps and potentially repeat the failed test in the after-script.

Having said that, I'd highly recommend using one "parallel" step instead, this way, you won't have to change a lot from your YAML configuration.

Here's the sample YAML configuration:

    feature/*:
        - step: *updateDevVersion_run
        - parallel:
            - step:
                #fail-fast: false
                name: 'Check commit message'
                runs-on: 
                    - self.hosted
                    - windows
                    - customrunner1
                <<: *commitCheck_run   
            - step:              
                # fail-fast: false  
                name: 'Check commit message [Backup]'
                runs-on: 
                    - self.hosted
                    - windows
                    - customrunner2
                <<: *commitCheck_run
            - step:
                #fail-fast: false
                name: 'TPT test'
                runs-on: 
                    - self.hosted
                    - windows
                    - customrunner1
                <<: *TPT_run
            - step:
                # fail-fast: false
                name: 'TPT test [Backup]'
                runs-on: 
                    - self.hosted
                    - windows
                    - customrunner2
                <<: *TPT_run         

 

Regards,
Mark C

0 votes
Sena Turku Cakmak August 19, 2024
image: atlassian/default-image:4


definitions:
steps:
    - step: &updateDevVersion_run
        name: 'Update development version'
        clone:
            depth: full
        script:
          - echo "Made a change in build ${BITBUCKET_BUILD_NUMBER}"

    - step: &commitCheck_run
        clone:
          enabled : true
        script:
          - echo "checking commits with custom runner"

    - step: &TPT_run
        clone:
          enabled : false
        script:
          - echo "running TPT test in custom runner";  

pipelines:
  branches:
    feature/*:
        - step: *updateDevVersion_run
        - parallel:
            - step:
                #fail-fast: false
                name: 'Check commit message'
                runs-on:
                    - self.hosted
                    - windows
                    - customrunner1
                <<: *commitCheck_run  
            - step:             
                # fail-fast: false 
                name: 'Check commit message [Backup]'
                runs-on:
                    - self.hosted
                    - windows
                    - customrunner2
                <<: *commitCheck_run

        - parallel:
            - step:
                #fail-fast: false
                name: 'TPT test'
                runs-on:
                    - self.hosted
                    - windows
                    - customrunner1
                <<: *TPT_run
            - step:
                # fail-fast: false
                name: 'TPT test [Backup]'
                runs-on:
                    - self.hosted
                    - windows
                    - customrunner2
                <<: *TPT_run          

 Here it is, hope this helps to solve the problem!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events