Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-50130

Artifacts are not archived when the build fails using parallel executions.

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • workflow-cps-plugin
    • None
    • Jenkins 2.89.4

      I am calling these functions

      zip(zipFile: "it-surefire-its-${stageKey}.zip", dir: 'surefire-its/target', archive: true)

      archiveArtifacts(artifacts: '*.zip', allowEmptyArchive: true, onlyIfSuccessful: false)

      When the build fails, the artifacts are not available for downloads.

      If is succeeds, they are available.

      This is the script https://github.com/apache/maven-surefire/blob/master/Jenkinsfile

      And you can try out this job for instance:

      https://builds.apache.org/job/maven-wip/job/maven-surefire/job/SUREFIRE-1495/

      I use function parallel() as well. Could it be the case?

      If I use similar script in my company without parallel(), the artifacts can be always downloaded.

          [JENKINS-50130] Artifacts are not archived when the build fails using parallel executions.

          Andrew Bayer added a comment -

          Throwing this in workflow-cps since it seems to be parallel at issue here, though this could be core, since that's where archiveArtifacts is from.

          Andrew Bayer added a comment - Throwing this in workflow-cps since it seems to be parallel at issue here, though this could be core, since that's where archiveArtifacts is from.

          Tibor Digana added a comment -

          abayer
          I also think it is parallelism issue. But what can we do about it? When the Jenkins designer has the code in mind she/he would recognize the issue candidate. Has the function parallel any notion about archivedArtifacts and the setting of the attribute onlyIfSuccessful?

          Tibor Digana added a comment - abayer I also think it is parallelism issue. But what can we do about it? When the Jenkins designer has the code in mind she/he would recognize the issue candidate. Has the function parallel any notion about archivedArtifacts and the setting of the attribute onlyIfSuccessful ?

          Tibor Digana added a comment -

          abayer
          Interesting thing is that the archived artifacts appear if the job fails continuously since the beginning.
          Similar to this:
          https://builds.apache.org/job/maven-box/job/maven-surefire/job/1512/
          I would say that once it becomes blue and then red, the artifacts would not appear in the list of Build Artifacts.

          Tibor Digana added a comment - abayer Interesting thing is that the archived artifacts appear if the job fails continuously since the beginning. Similar to this: https://builds.apache.org/job/maven-box/job/maven-surefire/job/1512/ I would say that once it becomes blue and then red, the artifacts would not appear in the list of Build Artifacts.

            Unassigned Unassigned
            tibor17 Tibor Digana
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: