Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build): activate failFast for parallel stages #446

Merged
merged 1 commit into from
Jul 1, 2023

Conversation

lemeurherve
Copy link
Member

@lemeurherve lemeurherve commented Jul 1, 2023

This PR activates failFast so the build stop whenever there is an error instead of waiting for the completion of every stage.

Testing done

Replayed with a voluntary error in the linux stage: https://ci.jenkins.io/job/Packaging/job/docker-agent/job/PR-446/3/

diff
--- old/Jenkinsfile
+++ new/Jenkinsfile
@@ -8,6 +8,7 @@
 
     stages {
         stage('Build') {
+            failFast true
             parallel {
                 stage('Windows') {
                     agent {
@@ -71,8 +72,9 @@
                         stage('Prepare Docker') {
                             steps {
                                 sh '''
-                                docker buildx create --use
-                                docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
+                                exit 1
+                                // docker buildx create --use
+                                // docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
                                 '''
                             }
                         }

Submitter checklist

Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've generally preferred to not failFast because it often means that I need to perform multiple runs in order to detect all the issues. Is there some benefit from failFast that I'm missing?

@lemeurherve
Copy link
Member Author

I guess it's a personal preference indeed.

As I now try to do smaller atomic pull requests there are less changes in each of them, and prefer the build to fail quickly instead of letting resources be wasted or cancelling builds manually.

I don't attach a lot of importance to this change, fine to me if this PR is closed.

@MarkEWaite
Copy link
Contributor

I guess it's a personal preference indeed.

No objection from me if it is merged. I was curious and you've answered my question well. Approved to merge once CI passes.

@MarkEWaite MarkEWaite enabled auto-merge (squash) July 1, 2023 13:34
@MarkEWaite MarkEWaite merged commit e723d4c into jenkinsci:master Jul 1, 2023
@dduportal dduportal added the chore label Jul 1, 2023
@lemeurherve lemeurherve deleted the patch-2 branch July 1, 2023 16:20
lemeurherve added a commit to lemeurherve/docker-agent that referenced this pull request Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants