useSticks
useSticks

Reputation: 904

How to limit concurrent matrix/multi-configuration builds in Jenkins

I have a multi-configuration job that uses a large amount of VMs for testing.

The Axis are something like: 30 VM slaves, 5 configurations, 5 different configurations

I would not like to run these sequentially, as the jobs would take forever. However, the default number of simultaneous runs is using up enough resources that I am getting random failures and disconnects.

Is there are way to specify the maximum number of simultaneous tests within this single running job?

Upvotes: 4

Views: 2817

Answers (2)

Frank Escobar
Frank Escobar

Reputation: 696

For multi project configuration

  1. First you need to create a throttle category. In this case, the name is qa-aut and I limiting the number of execution to 2 for concurrent builds and concurrent builds per node. The node will have 4 executors available. enter image description here

  2. In your job configuration, make sure you don't run the multi-project sequentially: enter image description here

  3. Set up throttling builds, selecting "Throttle this project as part of one or more categories", "Multi-Project Throttle Category"(qa-aut) and "Throttle Matrix configuration builds". You can leave in blank the rest of the values
    enter image description here

  4. Make sure your node/master has enough executors available. In this case, the master will have available 4 executors enter image description here

  5. Execute your multi-project job enter image description here

  6. Instead of using 4 executors (all the availability), you will see it's using only 2 executors (2 threads) as specified in the category.

enter image description here

Upvotes: 0

jherb
jherb

Reputation: 402

I think you have to use a matrix job to trigger the builds of a separate job doing the real build. Then you can use the Throttle Concurrent Builds Plugin to limit the number of parallel executions of that job you start by the matrix.

Upvotes: 3

Related Questions