diff --git a/.ci/Jenkinsfile_flaky b/.ci/Jenkinsfile_flaky index 9b44d01a8cfdc..123bd0779f567 100644 --- a/.ci/Jenkinsfile_flaky +++ b/.ci/Jenkinsfile_flaky @@ -16,23 +16,34 @@ def workerFailures = [] currentBuild.displayName += trunc(" ${params.GITHUB_OWNER}:${params.branch_specifier}", 24) currentBuild.description = "${params.CI_GROUP}
Executions: ${params.NUMBER_EXECUTIONS}" +// Note: If you increase agent count, it will execute NUMBER_EXECUTIONS per agent. It will not divide them up amongst the agents +// e.g. NUMBER_EXECUTIONS = 25, agentCount = 4 results in 100 total executions +def agentCount = 1 + stage("Kibana Pipeline") { timeout(time: 180, unit: 'MINUTES') { timestamps { ansiColor('xterm') { - catchError { - kibanaPipeline.withWorkers('flaky-test-runner', { - if (!IS_XPACK) { - kibanaPipeline.buildOss() - if (CI_GROUP == '1') { - runbld "./test/scripts/jenkins_build_kbn_tp_sample_panel_action.sh" - } - } else { - kibanaPipeline.buildXpack() + def agents = [:] + for(def agentNumber = 1; agentNumber <= agentCount; agentNumber++) { + agents["agent-${agentNumber}"] = { + catchError { + kibanaPipeline.withWorkers('flaky-test-runner', { + if (!IS_XPACK) { + kibanaPipeline.buildOss() + if (CI_GROUP == '1') { + runbld "./test/scripts/jenkins_build_kbn_tp_sample_panel_action.sh" + } + } else { + kibanaPipeline.buildXpack() + } + }, getWorkerMap(agentNumber, params.NUMBER_EXECUTIONS.toInteger(), worker, workerFailures))() } - }, getWorkerMap(params.NUMBER_EXECUTIONS.toInteger(), worker, workerFailures))() + } } + parallel(agents) + currentBuild.description += ", Failures: ${workerFailures.size()}" if (workerFailures.size() > 0) { @@ -66,22 +77,22 @@ def getWorkerFromParams(isXpack, job, ciGroup) { } } -def getWorkerMap(numberOfExecutions, worker, workerFailures, maxWorkers = 14) { +def getWorkerMap(agentNumber, numberOfExecutions, worker, workerFailures, maxWorkers = 14) { def workerMap = [:] def numberOfWorkers = Math.min(numberOfExecutions, maxWorkers) for(def i = 1; i <= numberOfWorkers; i++) { def workerExecutions = numberOfExecutions/numberOfWorkers + (i <= numberOfExecutions%numberOfWorkers ? 1 : 0) - workerMap["worker-${i}"] = { workerNumber -> + workerMap["agent-${agentNumber}-worker-${i}"] = { workerNumber -> for(def j = 0; j < workerExecutions; j++) { - print "Execute worker-${workerNumber}: ${j}" - withEnv(["JOB=worker-${workerNumber}-${j}"]) { + print "Execute agent-${agentNumber} worker-${workerNumber}: ${j}" + withEnv(["JOB=agent-${agentNumber}-worker-${workerNumber}-${j}"]) { catchError { try { worker(workerNumber) } catch (ex) { - workerFailures << "worker-${workerNumber}-${j}" + workerFailures << "agent-${agentNumber} worker-${workerNumber}-${j}" throw ex } } diff --git a/vars/kibanaPipeline.groovy b/vars/kibanaPipeline.groovy index d8448f9f686c3..d74f7ad31c5c4 100644 --- a/vars/kibanaPipeline.groovy +++ b/vars/kibanaPipeline.groovy @@ -143,7 +143,6 @@ def jobRunner(label, closure) { def uploadGcsArtifact(workerName, pattern) { def storageLocation = "gs://kibana-ci-artifacts/jobs/${env.JOB_NAME}/${BUILD_NUMBER}/${workerName}" // TODO - // def storageLocation = "gs://kibana-pipeline-testing/jobs/pipeline-test/${BUILD_NUMBER}/${workerName}" googleStorageUpload( credentialsId: 'kibana-ci-gcs-plugin',