From bf727b0f3bb996b5b1c6629a4678a51c263b39a0 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Fri, 17 Sep 2021 14:09:28 +0000 Subject: [PATCH] tests/crimson: don't be so verbose when run by the 'make check' bot. This commit is a try to balance crimson's debug facilities with overwhelming some hosts the `make check` bot runs on with huge number of log entries; see https://jenkins.ceph.com/job/ceph-pull-requests-arm64/17127/ for an exemplification of the problem. This is achieved by differentiating debug levels depending upon the `FOR_MAKE_CHECK` env variable. It's a hack / a makeshift solution only. IMHO ultimately we should introduce a dedicated target for the bot while leaving `ninja test` for humans which would allow for more debugs and maybe also for running `vstart.sh`-dependent tests. Signed-off-by: Radoslaw Zarzynski --- run-make-check.sh | 2 +- src/test/crimson/gtest_seastar.cc | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/run-make-check.sh b/run-make-check.sh index 9f5b8dfd9fa..85d58a3d310 100755 --- a/run-make-check.sh +++ b/run-make-check.sh @@ -102,7 +102,7 @@ function main() { configure "$cmake_opts" "$@" build tests echo "make check: successful build on $(git rev-parse HEAD)" - run + FOR_MAKE_CHECK=1 run } main "$@" diff --git a/src/test/crimson/gtest_seastar.cc b/src/test/crimson/gtest_seastar.cc index 2fd5e39fab8..175a744c765 100644 --- a/src/test/crimson/gtest_seastar.cc +++ b/src/test/crimson/gtest_seastar.cc @@ -1,6 +1,9 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#include +#include + #include "include/ceph_assert.h" #include "gtest_seastar.h" @@ -16,9 +19,16 @@ int main(int argc, char **argv) seastar_test_suite_t::seastar_env.init(argc, argv); - seastar::global_logger_registry().set_all_loggers_level( - seastar::log_level::debug - ); + // HACK: differntiate between the `make check` bot and human user + // for the sake of log flooding + if (std::getenv("FOR_MAKE_CHECK")) { + std::cout << "WARNING: bumping log level skipped due to FOR_MAKE_CHECK!" + << std::endl; + } else { + seastar::global_logger_registry().set_all_loggers_level( + seastar::log_level::debug + ); + } seastar_test_suite_t::seastar_env.run([] { return crimson::common::sharded_conf().start( -- 2.39.5