From 3443dc534c3bc0ecefa9d4dfb009d0250a542b4c Mon Sep 17 00:00:00 2001 From: Lan Xia Date: Thu, 23 May 2024 10:27:21 -0400 Subject: [PATCH] Enable time based parallel resolves: https://github.com/adoptium/ci-jenkins-pipelines/issues/1032 Signed-off-by: Lan Xia --- .../common/openjdk_build_pipeline.groovy | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/pipelines/build/common/openjdk_build_pipeline.groovy b/pipelines/build/common/openjdk_build_pipeline.groovy index 75d57edba..1b4eb54ce 100644 --- a/pipelines/build/common/openjdk_build_pipeline.groovy +++ b/pipelines/build/common/openjdk_build_pipeline.groovy @@ -374,6 +374,14 @@ class Build { } def aqaAutoGen = buildConfig.AQA_AUTO_GEN ?: false + def parallel = 'None' + def numMachinesPerTest = '' + def testTime = '' + // Enable time based parallel. Set expected completion time to 120 mins + if (enableTestDynamicParallel) { + testTime = '120' + parallel = 'Dynamic' + } testList.each { testType -> // For each requested test, i.e 'sanity.openjdk', 'sanity.system', 'sanity.perf', 'sanity.external', call test job @@ -416,20 +424,6 @@ class Build { } def jobParams = getAQATestJobParams(testType) - def parallel = 'None' - def numMachinesPerTest = '' - - if (enableTestDynamicParallel && dynamicList.contains(testType)) { - numMachinesPerTest = numMachines[(dynamicList.indexOf(testType))] - if (!numMachinesPerTest) { - // see build configuration in jdk*_pipeline_config.groovy - // when numMachines is an array, its size should match the testLists size - throw new Exception("No number of machines provided for running ${testType} tests in parallel, numMachines: ${numMachines}!") - } - context.println "Number of machines for running parallel tests: ${numMachinesPerTest}" - - parallel = 'Dynamic' - } def jobName = jobParams.TEST_JOB_NAME String helperRef = buildConfig.HELPER_REF ?: DEFAULTS_JSON['repository']['helper_ref'] @@ -478,6 +472,7 @@ class Build { context.booleanParam(name: 'KEEP_REPORTDIR', value: keep_test_reportdir), context.string(name: 'PARALLEL', value: parallel), context.string(name: 'NUM_MACHINES', value: "${numMachinesPerTest}"), + context.string(name: 'TEST_TIME', value: testTime), context.booleanParam(name: 'USE_TESTENV_PROPERTIES', value: useTestEnvProperties), context.booleanParam(name: 'GENERATE_JOBS', value: aqaAutoGen), context.string(name: 'ADOPTOPENJDK_BRANCH', value: aqaBranch),