Runnable r = makeBuildable(new BuildableItem(p)); if (r != null) { p.leave(this); if (causeOfBlockage == null) { Runnable r = makeBuildable(new BuildableItem(top)); String topTaskDisplayName = LOGGER.isLoggable(Level.FINEST) ? top.task.getFullDisplayName() : null; if (r != null) { Runnable r = makeFlyWeightTaskBuildable(new BuildableItem(p)); if (r != null) { p.leave(this);
makeBuildable(new BuildableItem(p)); makeBuildable(new BuildableItem(top)); } else {
makeBuildable(new BuildableItem(p)); makeBuildable(new BuildableItem(top)); } else {
Runnable r = makeBuildable(new BuildableItem(p)); if (r != null) { p.leave(this); if (causeOfBlockage == null) { Runnable r = makeBuildable(new BuildableItem(top)); String topTaskDisplayName = LOGGER.isLoggable(Level.FINEST) ? top.task.getFullDisplayName() : null; if (r != null) { Runnable r = makeFlyWeightTaskBuildable(new BuildableItem(p)); if (r != null) { p.leave(this);
makeBuildable(new BuildableItem(p)); makeBuildable(new BuildableItem(top)); } else {
makeBuildable(new BuildableItem(p)); makeBuildable(new BuildableItem(top)); } else {
/** * Test that it should not block buildable items. * * If you look at the Queue documentation, build enter the queue as waiting item, * then they become blocked item and finally the become buildable items. QueueTaskDispatcher.canRun * will get called one last time on buildable item before they can leave the queue but we do not * want ReplicationQueueTaskDispatcher to block them at that point. */ @Test public void shouldNotBlockBuildableItem() { PatchsetCreated patchsetCreated = Setup.createPatchsetCreated("someGerritServer", "someProject", "refs/changes/1/1/1"); Item item = createItem(patchsetCreated, new String[] {"slaveA", "slaveB", "slaveC"}); CauseOfBlockage cause = dispatcher.canRun(new Queue.BuildableItem((WaitingItem)item)); assertNull("Build should not be blocked", cause); }
/** * Test that it should not block buildable items. * * An Item is first checked when in the Queue. Once it canRun(), it is checked again when the executor * actually pulls it from the queue. But at that time, dependency-wise, we don't care anymore. */ @Test public void shouldNotBlockBuildableItem() { PatchsetCreated patchsetCreated = Setup.createPatchsetCreated("someGerritServer", "someProject", "refs/changes/1/1/1"); Queue.Item item = createItem(patchsetCreated, null); CauseOfBlockage cause = dispatcher.canRun(new Queue.BuildableItem((WaitingItem)item)); assertNull("Build should not be blocked", cause); }
/** * Test that it should not block an item the task of which is not an AbstractProject. */ @Test public void shouldNotBlockNonAbstractProjects() { List<Action> actions = new ArrayList<Action>(); Queue.Item item = new WaitingItem(Calendar.getInstance(), null, actions); CauseOfBlockage cause = dispatcher.canRun(new Queue.BuildableItem((WaitingItem)item)); assertNull("Build should not be blocked", cause); }