Skip to content

Commit a5bed11

Browse files
committed
Reduce CI console logging
* dtest: pytest --log-cli-level=DEBUG dropped to INFO * Jenkinsfile: filter ant "Forking using command" classpath echoes Patch by brandonwilliams, reviewed by mck for CASSANDRA-21624
1 parent 7ee239a commit a5bed11

2 files changed

Lines changed: 22 additions & 4 deletions

File tree

‎.build/run-python-dtests.sh‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ fi
196196
SPLIT_TESTS="${SPLIT_TESTS//$'\n'/ }"
197197

198198
pytest_results_file="${DIST_DIR}/test/output/nosetests.xml"
199-
pytest_opts="-vv --log-cli-level=DEBUG --junit-xml=${pytest_results_file} --junit-prefix=${DTEST_TARGET} -s"
199+
# INFO (not DEBUG): the driver's reconnect loop logs full tracebacks at DEBUG, which
200+
# floods the Jenkins console (tens of MB per cell) and the controller's in-memory step log
201+
pytest_opts="-vv --log-cli-level=INFO --junit-xml=${pytest_results_file} --junit-prefix=${DTEST_TARGET} -s"
200202

201203
echo ""
202204
echo "pytest ${pytest_opts} --cassandra-dir=${CASSANDRA_DIR} --keep-failed-test-dir ${DTEST_ARGS} ${SPLIT_TESTS}"

‎.jenkins/Jenkinsfile‎

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,22 @@ def isJdkEnabled(jdk) {
336336
return !params.jdk?.trim() || params.jdk.trim() == jdk
337337
}
338338

339+
/**
340+
* Noisy (but harmless) output lines, filtered from the in-memory console log.
341+
* The full output is still saved in the archived stage log (build/*.log.xz),
342+
* so this only trims what the controller holds in memory / renders in the UI.
343+
**/
344+
def consoleNoiseFilters() {
345+
return [
346+
"Forking using command" // ant echoes the full forked classpath before every maven forked run
347+
]
348+
}
349+
350+
// append a sed filter that drops lines matching consoleNoiseFilters() from a step's output
351+
def filterConsoleOutput(String script) {
352+
return "${script} | sed -e " + consoleNoiseFilters().collect { "/${it}/d" }.join(" -e ")
353+
}
354+
339355
/**
340356
* Renders build script into pipeline steps
341357
**/
@@ -363,7 +379,7 @@ def build(command, cell) {
363379
script_vars = "${script_vars} m2_dir=\'${WORKSPACE}/build/m2\'"
364380
timeout(time: 1, unit: 'HOURS') {
365381
try {
366-
def status = sh label: "RUNNING ${cell.step}...", script: "${script_vars} ${build_script} ${cell.jdk} 2>&1 | tee >( xz -c > build/${logfile} )", returnStatus: true
382+
def status = sh label: "RUNNING ${cell.step}...", script: filterConsoleOutput("${script_vars} ${build_script} ${cell.jdk} 2>&1 | tee >( xz -c > build/${logfile} )"), returnStatus: true
367383
dir("build") {
368384
archiveArtifacts artifacts: "${logfile}", fingerprint: true
369385
copyToNightlies("${logfile}", "${cell.step}/jdk${cell.jdk}/${cell.arch}/")
@@ -428,7 +444,7 @@ def test(command, cell) {
428444
try {
429445
buildJVMDTestJars(cell, script_vars, logfile)
430446
script_vars = "${script_vars} docker_timeout_hours=\"${command.timeout_hours}\""
431-
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
447+
def status = sh label: "RUNNING TESTS ${cell.step}...", script: filterConsoleOutput("${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
432448
dir("build") {
433449
archiveArtifacts artifacts: "${logfile}", fingerprint: true
434450
}
@@ -495,7 +511,7 @@ def buildJVMDTestJars(cell, script_vars, logfile) {
495511
try {
496512
unstash name: "jvm_dtests_${cell.arch}_${cell.jdk}"
497513
} catch (error) {
498-
sh label: "RUNNING build_dtest_jars...", script: "${script_vars} .build/docker/run-tests.sh -a build_dtest_jars -j ${cell.jdk} 2>&1 | tee >( xz -c > build/${logfile} )"
514+
sh label: "RUNNING build_dtest_jars...", script: filterConsoleOutput("${script_vars} .build/docker/run-tests.sh -a build_dtest_jars -j ${cell.jdk} 2>&1 | tee >( xz -c > build/${logfile} )")
499515
stash name: "jvm_dtests_${cell.arch}_${cell.jdk}", includes: '**/dtest*.jar'
500516
}
501517
}

0 commit comments

Comments
 (0)