Move dmesg dumping out from runner to ci-runner.py

runner is used by developers to run tests, while ci-runner.py is used
only by CI scripts, and to avoid requiring CAP_SYSLOG for manual dmesg
clear/dump had been moved.

Also for manual runs this can be done manually.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
Azat Khuzhin 2022-12-28 11:08:37 +01:00
parent 8a2fbbe88c
commit 03f80bae90
2 changed files with 13 additions and 6 deletions

View File

@ -983,9 +983,22 @@ if __name__ == "__main__":
runner = ClickhouseIntegrationTestsRunner(result_path, params)
logging.info("Running tests")
# Avoid overlaps with previous runs
logging.info("Clearing dmesg before run")
subprocess.check_call( # STYLE_CHECK_ALLOW_SUBPROCESS_CHECK_CALL
"dmesg --clear", shell=True
)
state, description, test_results, _ = runner.run_impl(repo_path, build_path)
logging.info("Tests finished")
# Dump dmesg (to capture possible OOMs)
logging.info("Dumping dmesg")
subprocess.check_call( # STYLE_CHECK_ALLOW_SUBPROCESS_CHECK_CALL
"dmesg -T", shell=True
)
status = (state, description)
out_results_file = os.path.join(str(runner.path()), "test_results.tsv")
out_status_file = os.path.join(str(runner.path()), "check_status.tsv")

View File

@ -413,11 +413,5 @@ if __name__ == "__main__":
subprocess.check_call(f"docker kill {' '.join(containers)}", shell=True)
print(f"Containers {containers} killed")
# Avoid overlaps with previous runs
subprocess.check_call("dmesg --clear", shell=True)
print(("Running pytest container as: '" + cmd + "'."))
subprocess.check_call(cmd, shell=True)
# Dump dmesg (to capture possible OOMs)
subprocess.check_call("dmesg -T", shell=True)