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

"DELETE generated files" doesnt always work when parralel jobs run

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • p4-plugin
    • None

      Create pipeline job that uses following Jenkinsfile via "Pipeline script from SCM":

      pipeline {
        agent { label 'master' }
        stages {
          stage("Repro") {
            steps {
              script {
                sh "pwd"
                sh "ls -l"
                sh "if [ -e this_should_be_cleaned_up ]; then false; else true; fi"
                input(message: "Fake input to reproduce, please DO NOT proceed, just start another build of this job",
                  parameters: [booleanParam(defaultValue: false, description: "", name: "Mocked choice")])
                sh "touch this_should_be_cleaned_up"
              }
            }
          }
        }
      }
      
      

      Perform following test:

      1. Start job, wait until it asks for input, DO NOT PROCEED
      2. Start the job again, it will go to input stage
      3. Proceed on both builds (by entering text in console)
      4. Start job again, wait until it asks for input, DO NOT PROCEED
      5. Start the job again it will immediately FAIL, because file "~jenkins/workspace/JOB_NAME@2/this_should_be_cleaned_up" was not deleted during the checkout stage

      From now on, you can repeat steps 4 and 5, it will reproduce every time.

       

      Different workspaces are used for the parallel jobs but 'JOB_NAME@2' is not cleaned up in this scenario.

            p4karl Karl Wirth
            p4karl Karl Wirth
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: