Situation
Set up the build so that one agent runs only one build at a time. If all agents are occupied, the build should be waiting.
Demonstration
- Check grid tab
on the demo site, and there are two agents available.
- Visit the control project
, and hit the run button to trigger all its children (project1, project2 and project3) concurrently.
- Check the queue tab
. Only two child builds will be running, each occupying one agent. The waiting child build will start to run when one of the running child builds finishes.
Resolution
- Switch to resources tab
and a resource named "Agent" is defined with each agent providing one resource.
- Check master step definition of child project1
, child project2
, and child project3
. They all set to run on node with resource Agent. If resource requirement of the master step is not satisfied, the build itself will be put into waiting state.