Backport #62556 to 24.3: Fix integration-tests logs compression

This commit is contained in:
robot-clickhouse 2024-04-12 15:08:09 +00:00
parent 8642ce418b
commit add1764b81
2 changed files with 9 additions and 15 deletions

View File

@ -83,7 +83,7 @@ jobs:
${{secrets.ROBOT_CLICKHOUSE_SSH_KEY}}
RCSK
FastTest:
needs: [RunConfig, StyleCheck]
needs: [RunConfig, BuildDockers]
if: ${{ !failure() && !cancelled() && contains(fromJson(needs.RunConfig.outputs.data).jobs_data.jobs_to_do, 'Fast test') }}
uses: ./.github/workflows/reusable_test.yml
with:

View File

@ -13,13 +13,13 @@ import string
import subprocess
import sys
import time
from typing import Any, Dict
import zlib # for crc32
from collections import defaultdict
from itertools import chain
from typing import Any, Dict
from integration_test_images import IMAGES
from env_helper import CI
from integration_test_images import IMAGES
MAX_RETRY = 1
NUM_WORKERS = 5
@ -395,9 +395,9 @@ class ClickhouseIntegrationTestsRunner:
@staticmethod
def _compress_logs(directory, relpaths, result_path):
retcode = subprocess.call( # STYLE_CHECK_ALLOW_SUBPROCESS_CHECK_CALL
f"tar --use-compress-program='zstd --threads=0' -cf {result_path} -C "
f"{directory} {' '.join(relpaths)}",
retcode = subprocess.call(
f"sudo tar --use-compress-program='zstd --threads=0' "
f"-cf {result_path} -C {directory} {' '.join(relpaths)}",
shell=True,
)
# tar return 1 when the files are changed on compressing, we ignore it
@ -430,9 +430,7 @@ class ClickhouseIntegrationTestsRunner:
"Getting all tests to the file %s with cmd: \n%s", out_file_full, cmd
)
with open(out_file_full, "wb") as ofd:
subprocess.check_call( # STYLE_CHECK_ALLOW_SUBPROCESS_CHECK_CALL
cmd, shell=True, stdout=ofd, stderr=ofd
)
subprocess.check_call(cmd, shell=True, stdout=ofd, stderr=ofd)
all_tests = set()
with open(out_file_full, "r", encoding="utf-8") as all_tests_fd:
@ -1005,9 +1003,7 @@ def run():
if CI:
# Avoid overlaps with previous runs
logging.info("Clearing dmesg before run")
subprocess.check_call( # STYLE_CHECK_ALLOW_SUBPROCESS_CHECK_CALL
"sudo -E dmesg --clear", shell=True
)
subprocess.check_call("sudo -E dmesg --clear", shell=True)
state, description, test_results, _ = runner.run_impl(repo_path, build_path)
logging.info("Tests finished")
@ -1015,9 +1011,7 @@ def run():
if CI:
# Dump dmesg (to capture possible OOMs)
logging.info("Dumping dmesg")
subprocess.check_call( # STYLE_CHECK_ALLOW_SUBPROCESS_CHECK_CALL
"sudo -E dmesg -T", shell=True
)
subprocess.check_call("sudo -E dmesg -T", shell=True)
status = (state, description)
out_results_file = os.path.join(str(runner.path()), "test_results.tsv")