Skip to content

Commit

Permalink
Enable time based parallel
Browse files Browse the repository at this point in the history
resolves: #1032
Signed-off-by: Lan Xia <[email protected]>
  • Loading branch information
llxia committed May 23, 2024
1 parent 99510b4 commit 3443dc5
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions pipelines/build/common/openjdk_build_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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']
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 3443dc5

Please sign in to comment.