JM Running

Jenkins Job Control with Parallel JMeter Projects

On this page we show how we can run projects in parallel, for those cases where applications share server resources and integration testing is required.

Typically, we run tests by triggering an environment build with a cron setting (once a day at 5am for example) and setting that job to call the test run job and then calling the tear down job if that passes - note, if the test fails, we leave the environment up so we can investigate any issues:

Build the test environment in the cloud every morning at 5am:


Set this job to trigger the performance test run:


Set the performance test build to trigger the environment tear down if everything goes well:


The above scenario works well for a lot of CI projects, as we build bespoke environments anyway, but sometimes you need to run more than one project concurrently. In this situation, you can use the build flow plugin and a groovy script to add a bit more control on the builds and tear downs. Note: to run two of the jmeter performance tests concurrently, you need to set up two cloud jenkins server controllers and set them to allow only one job concurrently on each. uses groovy scripts. The following script builds an environment, runs two performance tests in parallel and shuts down the test environment only if both tests pass. Note: the tests themselves take care of sparking up their own test injectors and shutting them down when finished:

out.println  'Starting build control script'
b = build( "BIPs CI Perf step 1A - build perf env (S3 bucket)" )

// output values
//out.println 'Triggered Parameters Map:'
//out.println params
//out.println 'Build Object Properties:'
// { out.println "$it.key -> $it.value" }

out.println  'BIPs CI Perf step 1A - build perf env (S3 bucket) = ' +

if ( == SUCCESS )
   parallel (
       // job 1, 2 and 3 will be scheduled in parallel.
       { c = build("BIPs CI Perf step 2A - run test (dev)") },
       { d = build("BIPs CI Perf step 2A - run test (service)") }

   out.println  'BIPs CI Perf step 2A - run test (dev) = ' +
   out.println  'BIPs CI Perf step 2A - run test (service) = ' +

   if ( == SUCCESS && == SUCCESS )
       e = build("BIPS CI Perf step 3 - teardown bips perf env")
       out.println  'BIPS CI Perf step 3 - teardown bips perf env = ' +
       out.println  'dev or service tests failed. Not running tear down'
   out.println  'Env build failed. Not running tests or tear down'
out.println  'Finished build control script'

[Home] [About (CV)] [Contact Us] [JMeter Cloud] [JM Highlights] [JM Overview] [JM Control] [JM Inject] [JM Threads] [JM Results] [JM Assertions] [JM TPS] [JM Metrics] [JM Runtime] [JM Collation] [JM Logs] [JM 95th] [JM 95th v2] [JM Jenkins] [JM Corporate] [JM Scripts] [JM Variables] [JM Embedded] [JM Hosts] [JM Running] [JM Example] [JM Versions] [webPageTest] [_64 images] [asset moniitor] [Linux Monitor] [Splunk ETL] [Splunk API] [AWS bash] [LR Rules OK] [LR Slave] [LR CI Graphs] [LoadRunner CI] [LR CI Variables] [LR Bamboo] [LR Methods] [LR CI BASH] [Bash methods] [Jenkins V2] [Streaming vid] [How fast] [Finding Issues] [Reporting] [Hand over] [VB Scripts] [JMeter tips] [JMeter RAW] [Dynatrace] [Documents] [FAQ] [Legal]

In the Cartesian Elements Ltd group of companies