Skip to content

Commit

Permalink
Delete test which no longer works in 1.521+ due to improved core beha…
Browse files Browse the repository at this point in the history
…vior from JENKINS-18407

Due to the improved core behavior, in JobInvocation.groovy's run()
method, schedule2() no longer returns null when invoked from the test.
  • Loading branch information
rodrigc committed Apr 30, 2016
1 parent 0e0b66d commit faeaa5c
Showing 1 changed file with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions src/test/groovy/com/cloudbees/plugins/flow/ConcurrencyTest.groovy
Expand Up @@ -82,60 +82,4 @@ class ConcurrencyTest extends DSLTestCase {
assertRan(concjob1, 4, SUCCESS);
}


/**
* Test that triggering multiple builds of the same non-concurrent build gives an appropriate error.
* This relies on the default quiet period of 5 seconds.
*/
public void testConcurrencyWithNonConcurrentDownstream() {
Jenkins.instance.numExecutors = 8
Jenkins.instance.reload()

File f1 = new File("target/concjob2.block")
// this will prevent job1 from running.
f1.createNewFile();

def concjob2 = createBlockingJob("concjob2", f1)

BuildFlow flow = new BuildFlow(Jenkins.instance, getName())
flow.concurrentBuild = true;
flow.dsl = """ build("concjob2") """

def sfr1 = flow.scheduleBuild2(0)
def fr1 = sfr1.waitForStart()

def sfr2 = flow.scheduleBuild2(0)
def fr2 = sfr2.waitForStart()

def sfr3 = flow.scheduleBuild2(0)
def fr3 = sfr3.waitForStart()

def sfr4 = flow.scheduleBuild2(0)
def fr4 = sfr4.waitForStart()

// we have a 5 second quiet period!
// This sleep does not add to the execution time of the test as we just wait for the builds to complete anyway.
Thread.sleep(6000L);
println("releasing jobs")
f1.delete();

// wait for all the flows to finish.
sfr1.get();
sfr2.get();
sfr3.get();
sfr4.get();

// all 4 jobs should not have completed successfully as some should have failed to scheduled a job.
// however there is some timing involved here so it could be a little intermittent.
assertBuildStatusSuccess(fr1);
// some of the next three should have failed.
def atLeastOneRunFailed = false;
for (run in [fr2, fr3, fr4] ) {
if (run.result.isWorseOrEqualTo(SUCCESS)) {
atLeastOneRunFailed = true
assertLogContains("Could not schedule job concjob2, ensure it is not already queued with the same parameters or is not disabled", run)
}
}
assertTrue("At least on build should have failed", atLeastOneRunFailed)
}
}

0 comments on commit faeaa5c

Please sign in to comment.