From 5aba66e50a98f040daaa3c2235310e68cfa45e55 Mon Sep 17 00:00:00 2001 From: Yakov Olkhovskiy Date: Mon, 4 Nov 2024 03:13:42 +0000 Subject: [PATCH] adjust CI timeout, use TIMEOUT variable for setting fuzzers timeout --- docker/test/libfuzzer/Dockerfile | 2 -- tests/ci/ci_config.py | 2 +- tests/ci/libfuzzer_test_check.py | 3 +++ tests/fuzz/runner.py | 8 ++------ 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/docker/test/libfuzzer/Dockerfile b/docker/test/libfuzzer/Dockerfile index 3ffae0cd921..46e305c90ab 100644 --- a/docker/test/libfuzzer/Dockerfile +++ b/docker/test/libfuzzer/Dockerfile @@ -33,8 +33,6 @@ RUN apt-get update \ COPY requirements.txt / RUN pip3 install --no-cache-dir -r /requirements.txt -ENV FUZZER_ARGS="-max_total_time=60" - SHELL ["/bin/bash", "-c"] # docker run --network=host --volume :/workspace -e PR_TO_TEST=<> -e SHA_TO_TEST=<> clickhouse/libfuzzer diff --git a/tests/ci/ci_config.py b/tests/ci/ci_config.py index b4b7dbee59c..80da822652f 100644 --- a/tests/ci/ci_config.py +++ b/tests/ci/ci_config.py @@ -530,7 +530,7 @@ class CI: JobNames.LIBFUZZER_TEST: JobConfig( required_builds=[BuildNames.FUZZERS], run_by_labels=[Tags.libFuzzer], - timeout=10800, + timeout=5400, run_command='libfuzzer_test_check.py "$CHECK_NAME"', runner_type=Runners.FUNC_TESTER, ), diff --git a/tests/ci/libfuzzer_test_check.py b/tests/ci/libfuzzer_test_check.py index 379d681cb3e..d0936eb2323 100644 --- a/tests/ci/libfuzzer_test_check.py +++ b/tests/ci/libfuzzer_test_check.py @@ -22,6 +22,7 @@ from stopwatch import Stopwatch from tee_popen import TeePopen NO_CHANGES_MSG = "Nothing to run" +TIMEOUT = 60 s3 = S3Helper() @@ -264,6 +265,8 @@ def main(): check_name, run_by_hash_num, run_by_hash_total ) + additional_envs.append(f"TIMEOUT={TIMEOUT}") + ci_logs_credentials = CiLogsCredentials(Path(temp_path) / "export-logs-config.sh") ci_logs_args = ci_logs_credentials.get_docker_arguments( pr_info, stopwatch.start_time_str, check_name diff --git a/tests/fuzz/runner.py b/tests/fuzz/runner.py index af73a989ec3..0880940aabd 100644 --- a/tests/fuzz/runner.py +++ b/tests/fuzz/runner.py @@ -9,7 +9,7 @@ import subprocess from pathlib import Path DEBUGGER = os.getenv("DEBUGGER", "") -FUZZER_ARGS = os.getenv("FUZZER_ARGS", "") +TIMEOUT = int(os.getenv("TIMEOUT", "0")) OUTPUT = "/test_output" @@ -150,11 +150,7 @@ def main(): subprocess.check_call("ls -al", shell=True) - timeout = 60 - - match = re.search(r"(^|\s+)-max_total_time=(\d+)($|\s)", FUZZER_ARGS) - if match: - timeout = int(match.group(2)) + timeout = 30 if TIMEOUT == 0 else TIMEOUT with Path() as current: for fuzzer in current.iterdir():