In our steps towards Continuous Integration we split the build job into two parts:
- Fast running essentials
- Slower heavy tasks
The goal is to always have the first one run through in less than 10 minutes and only contains build, unit-test and deploy to artifact-repository. The second one may also take hours.
Currently we have one master that is handling everything, no slaves. The master has two executors. This can not be changed.
What I want to do is make the heavy one wait for two slots to be open in order to assure there is always one executor available for fast running tasks.
Heavy may run:
FastJob: -------xxxxxxxx---------xxxxx-------xxxxx------xxxxxxx-
LongJob: ---xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-----------------
Heavy has to wait:
FastJob: --xxxxxx--xxxxxxxx---------xxxxx-------xxxxx-----------
LongJob: ---wwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-----------
--- = nothing
xxx = executing build
www = waiting
I already looked at the Heavy Job Plugin, however that does not solve this issue as it blocks both executors afterwards. The heavy job shall wait until two executors are free and then only block one.
Also see the follow up question about the reservation of x% of the executors.