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:
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
Thank you for reaching out to the community.
Could you share your Pipelines YAML file but masking any sensitive information?
Regards,
Mark C
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.