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

Race condition in concurrently executed tests running short Pipeline jobs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Labels:
      None
    • Environment:
      Plugin parent 2.11, workflow-cps plugin 2.10, Jenkins core 2.7, workflow-multibranch plugin 2.8, workflow-job plugin 2.15 (via multibranch)
    • Similar Issues:

      Description

      I'm running into situations where tests pass fine when run individually or serially, but some of them will fail when run in the standard concurrency from the plugin parent. Output from such a failed test looks like https://gist.github.com/abayer/7eb7bb645efa181ecd869b04017fea74 - note that the compilation error there is actually the desired result, but when I use story.j.assertLogContains("MultipleCompilationErrorsException: startup failed"), the test fails, and the test failure output doesn't have anything after First time build. Skipping changelog.. The tests are fairly simple - along the lines of:

              // Stuff constructing sampleRepo
              WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "p");
              p.setDefinition(new CpsScmFlowDefinition(new GitStep(sampleRepo.toString()).createSCM(), "Jenkinsfile"));
              WorkflowRun b = p.scheduleBuild2(0).waitForStart();
              story.j.assertBuildStatus(Result.FAILURE, story.j.waitForCompletion(b));
              story.j.assertLogContains("MultipleCompilationErrorsException: startup failed:", b);
      

        Attachments

          Activity

          Hide
          abayer Andrew Bayer added a comment -

          Note that this was all with jobs with the same name, so there may be correlation there. So far, when switching to use story.j.createProject(WorkflowJob.class) to get a random name per job, I haven't seen this.

          Show
          abayer Andrew Bayer added a comment - Note that this was all with jobs with the same name, so there may be correlation there. So far, when switching to use story.j.createProject(WorkflowJob.class) to get a random name per job, I haven't seen this.
          Hide
          jglick Jesse Glick added a comment -

          Are you using @ClassRule by any chance? If so, your pain is your own.

          Show
          jglick Jesse Glick added a comment - Are you using @ClassRule by any chance? If so, your pain is your own.
          Hide
          abayer Andrew Bayer added a comment -

          This hasn't been an issue for ages and I can't reproduce it now, so closing.

          Show
          abayer Andrew Bayer added a comment - This hasn't been an issue for ages and I can't reproduce it now, so closing.

            People

            • Assignee:
              jglick Jesse Glick
              Reporter:
              abayer Andrew Bayer
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: