From 3cdd540bfead9d1c1b119c3234f08f4e6be15c27 Mon Sep 17 00:00:00 2001 From: mck Date: Fri, 20 Dec 2024 19:10:37 +1100 Subject: [PATCH] Timing info for each test split in Jenkinsfile patch by Mick Semb Wever; reviewed by Brandon Williams for CASSANDRA-20157 --- .jenkins/Jenkinsfile | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.jenkins/Jenkinsfile b/.jenkins/Jenkinsfile index 4f8ad6c268..d7c84eba80 100644 --- a/.jenkins/Jenkinsfile +++ b/.jenkins/Jenkinsfile @@ -157,6 +157,11 @@ def tasks() { } def testSteps = [ + // Each splits size need to be high enough to avoid the one hour per split timeout, + // and low enough so test time is factors more than the setup+build time in each split. + // Splits can also be poorly balanced: splitting or renaming test classes is the best tactic. + // On unsaturated systems 10 minutes per split is optimal, higher with saturation + // (some buffer on the heaviest split under the 1h max is required, ref `timeout(…)` in `test(…)`) 'cqlsh-test': [splits: 1], 'fqltool-test': [splits: 1, size: 'small'], 'test-cdc': [splits: 8], @@ -383,13 +388,20 @@ def test(command, cell) { } script_vars = fetchDTestsSource(command, script_vars) timeout(time: 1, unit: 'HOURS') { // best throughput with each cell at ~10 minutes - buildJVMDTestJars(cell, script_vars, logfile) - def status = sh label: "RUNNING TESTS ${cell.step}...", script: "${script_vars} .build/docker/run-tests.sh -a ${cell.step} -c '${cell.split}/${splits}' -j ${cell.jdk} 2>&1 | tee >( xz -c > build/${logfile} )", returnStatus: true - dir("build") { - archiveArtifacts artifacts: "${logfile}", fingerprint: true - copyToNightlies("${logfile}", "${cell.step}/${cell.arch}/jdk${cell.jdk}/python${cell.python}/cython_${cell.cython}/" + "split_${cell.split}_${splits}".replace("/", "_")) + def timer = System.currentTimeMillis() + try { + buildJVMDTestJars(cell, script_vars, logfile) + def status = sh label: "RUNNING TESTS ${cell.step}...", script: "${script_vars} .build/docker/run-tests.sh -a ${cell.step} -c '${cell.split}/${splits}' -j ${cell.jdk} 2>&1 | tee >( xz -c > build/${logfile} )", returnStatus: true + dir("build") { + archiveArtifacts artifacts: "${logfile}", fingerprint: true + copyToNightlies("${logfile}", "${cell.step}/${cell.arch}/jdk${cell.jdk}/python${cell.python}/cython_${cell.cython}/" + "split_${cell.split}_${splits}".replace("/", "_")) + } + if (0 != status) { error("Stage ${cell.step}${cell_suffix} failed with exit status ${status}") } + } finally { + def duration = System.currentTimeMillis() - timer + def formattedTime = String.format("%tT.%tL", duration, duration) + echo "Time ${cell.step}${cell_suffix}: ${formattedTime}" } - if (0 != status) { error("Stage ${cell.step}${cell_suffix} failed with exit status ${status}") } } dir("build") { sh """