cjo9900/parameterized-trigger-plugin — pull request #1 by kinow (2012-07-20 16:47:28+00:00)
Title: JENKINS-14278: added code to make sure that the number of executors is updated

JENKINS-14278: added code to make sure that the number of executors is updated

For tracking what was causing this issue, I put a breakpoint before the first
Future#get() method call, as the execution was dying there. Then I called
the HudsonTestCase#getURL() method, to get the Jenkins URL (it's very convenient).

This way I could see the jobs configuration, it was very useful since I don't
know very well the objects created by parameterized-trigger-plugin. Then I
noticed there were only two executors.

Following the debug stack, I found later that project1 was waiting for another
project (I think it was projectZ4 maybe? sorry, I closed the debugger already) and
that this latter project was waiting for another project that was never executed.

Going back to Jenkins main page, there were only two executors, even after
Hudson#setNumExecutors(10) was called. Then I had a quick look at Jenkins#doSubmitConfig(...)
method, and realized that after updating the number of executors, you had to
update the nodes/computers configuration as well.

Then, as I'm a lazy bastard, I went to my search engine and searched for
Jenkins setnumexecutors and found some code with the following code snippet:
hudson.setNodes(hudson.getNodes());

I think the method that needs to be called after setNumExecutors is updateComputerList,
that is package protected, but is called from this setNodes method.

And then all the tests passed :)

Other files were changed to remove warnings in Eclipse, to use hamcrest-1.3 as
maven couldn't find hamcrest-1.2 or for compliance with Java 1.5 (@Override
annotations). These changes are not required to fix this issue.

Hope that helps.
Bruno