From cc6fd38dc616b2ab98b3c9fce6ae10877fb28e0f Mon Sep 17 00:00:00 2001 From: Yakov Olkhovskiy Date: Wed, 20 Nov 2024 22:41:13 +0000 Subject: [PATCH 1/8] preliminary: prevent uploading corpus if running in PR --- tests/ci/libfuzzer_test_check.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/ci/libfuzzer_test_check.py b/tests/ci/libfuzzer_test_check.py index 2616fbe3f5d..d1e6b34309e 100644 --- a/tests/ci/libfuzzer_test_check.py +++ b/tests/ci/libfuzzer_test_check.py @@ -286,7 +286,11 @@ def main(): retcode = process.wait() if retcode == 0: logging.info("Run successfully") - upload_corpus(fuzzers_path) + if pr_info.number == 0 and pr_info.base_ref == "master" and pr_info.head_ref == "master": + logging.info("Uploading corpus - running in master") + # upload_corpus(fuzzers_path) + else: + logging.info("Not uploading corpus - running in PR") else: logging.info("Run failed") From 6d4c26dda5ab36b9a37b64f23686cce57ae37fc7 Mon Sep 17 00:00:00 2001 From: robot-clickhouse Date: Wed, 20 Nov 2024 22:50:39 +0000 Subject: [PATCH 2/8] Automatic style fix --- tests/ci/libfuzzer_test_check.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/ci/libfuzzer_test_check.py b/tests/ci/libfuzzer_test_check.py index d1e6b34309e..55db6f8e235 100644 --- a/tests/ci/libfuzzer_test_check.py +++ b/tests/ci/libfuzzer_test_check.py @@ -286,7 +286,11 @@ def main(): retcode = process.wait() if retcode == 0: logging.info("Run successfully") - if pr_info.number == 0 and pr_info.base_ref == "master" and pr_info.head_ref == "master": + if ( + pr_info.number == 0 + and pr_info.base_ref == "master" + and pr_info.head_ref == "master" + ): logging.info("Uploading corpus - running in master") # upload_corpus(fuzzers_path) else: From 2313b7ca78b734dc8300ba07007ce5fa95c4d098 Mon Sep 17 00:00:00 2001 From: Yakov Olkhovskiy Date: Thu, 21 Nov 2024 01:59:12 +0000 Subject: [PATCH 3/8] update: prevent uploading corpus if running in PR, add sanitizers --- tests/ci/ci_config.py | 36 ++++++++++++++++++++++++++++++++ tests/ci/ci_definitions.py | 4 ++++ tests/ci/libfuzzer_test_check.py | 2 +- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/tests/ci/ci_config.py b/tests/ci/ci_config.py index a170dfdd8d1..cca93f5a488 100644 --- a/tests/ci/ci_config.py +++ b/tests/ci/ci_config.py @@ -278,6 +278,42 @@ class CI: ), run_by_labels=[Tags.libFuzzer], ), + BuildNames.FUZZERS_ASAN: CommonJobConfigs.BUILD.with_properties( + build_config=BuildConfig( + name=BuildNames.FUZZERS_ASAN, + compiler="clang-18", + sanitizer="address", + package_type="fuzzers", + ), + run_by_labels=[Tags.libFuzzer], + ), + BuildNames.FUZZERS_UBSAN: CommonJobConfigs.BUILD.with_properties( + build_config=BuildConfig( + name=BuildNames.FUZZERS_UBSAN, + compiler="clang-18", + sanitizer="undefined", + package_type="fuzzers", + ), + run_by_labels=[Tags.libFuzzer], + ), + BuildNames.FUZZERS_TSAN: CommonJobConfigs.BUILD.with_properties( + build_config=BuildConfig( + name=BuildNames.FUZZERS_TSAN, + compiler="clang-18", + sanitizer="thread", + package_type="fuzzers", + ), + run_by_labels=[Tags.libFuzzer], + ), + BuildNames.FUZZERS_MSAN: CommonJobConfigs.BUILD.with_properties( + build_config=BuildConfig( + name=BuildNames.FUZZERS_MSAN, + compiler="clang-18", + sanitizer="memory", + package_type="fuzzers", + ), + run_by_labels=[Tags.libFuzzer], + ), JobNames.BUILD_CHECK: CommonJobConfigs.BUILD_REPORT.with_properties(), JobNames.INSTALL_TEST_AMD: CommonJobConfigs.INSTALL_TEST.with_properties( required_builds=[BuildNames.PACKAGE_RELEASE] diff --git a/tests/ci/ci_definitions.py b/tests/ci/ci_definitions.py index d55e347c3ee..ad15d692944 100644 --- a/tests/ci/ci_definitions.py +++ b/tests/ci/ci_definitions.py @@ -123,6 +123,10 @@ class BuildNames(metaclass=WithIter): BINARY_S390X = "binary_s390x" BINARY_LOONGARCH64 = "binary_loongarch64" FUZZERS = "fuzzers" + FUZZERS_ASAN = "fuzzers_asan" + FUZZERS_UBSAN = "fuzzers_ubsan" + FUZZERS_TSAN = "fuzzers_tsan" + FUZZERS_MSAN = "fuzzers_msan" class JobNames(metaclass=WithIter): diff --git a/tests/ci/libfuzzer_test_check.py b/tests/ci/libfuzzer_test_check.py index 55db6f8e235..6783f5c1613 100644 --- a/tests/ci/libfuzzer_test_check.py +++ b/tests/ci/libfuzzer_test_check.py @@ -292,7 +292,7 @@ def main(): and pr_info.head_ref == "master" ): logging.info("Uploading corpus - running in master") - # upload_corpus(fuzzers_path) + upload_corpus(fuzzers_path) else: logging.info("Not uploading corpus - running in PR") else: From e87ac61ff31d88da51cb614f919ca43785b0d0f8 Mon Sep 17 00:00:00 2001 From: Yakov Olkhovskiy Date: Thu, 21 Nov 2024 02:36:58 +0000 Subject: [PATCH 4/8] fix: only asan --- tests/ci/ci_config.py | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/tests/ci/ci_config.py b/tests/ci/ci_config.py index cca93f5a488..adb0881ecd5 100644 --- a/tests/ci/ci_config.py +++ b/tests/ci/ci_config.py @@ -271,14 +271,6 @@ class CI: ), ), BuildNames.FUZZERS: CommonJobConfigs.BUILD.with_properties( - build_config=BuildConfig( - name=BuildNames.FUZZERS, - compiler="clang-18", - package_type="fuzzers", - ), - run_by_labels=[Tags.libFuzzer], - ), - BuildNames.FUZZERS_ASAN: CommonJobConfigs.BUILD.with_properties( build_config=BuildConfig( name=BuildNames.FUZZERS_ASAN, compiler="clang-18", @@ -287,33 +279,6 @@ class CI: ), run_by_labels=[Tags.libFuzzer], ), - BuildNames.FUZZERS_UBSAN: CommonJobConfigs.BUILD.with_properties( - build_config=BuildConfig( - name=BuildNames.FUZZERS_UBSAN, - compiler="clang-18", - sanitizer="undefined", - package_type="fuzzers", - ), - run_by_labels=[Tags.libFuzzer], - ), - BuildNames.FUZZERS_TSAN: CommonJobConfigs.BUILD.with_properties( - build_config=BuildConfig( - name=BuildNames.FUZZERS_TSAN, - compiler="clang-18", - sanitizer="thread", - package_type="fuzzers", - ), - run_by_labels=[Tags.libFuzzer], - ), - BuildNames.FUZZERS_MSAN: CommonJobConfigs.BUILD.with_properties( - build_config=BuildConfig( - name=BuildNames.FUZZERS_MSAN, - compiler="clang-18", - sanitizer="memory", - package_type="fuzzers", - ), - run_by_labels=[Tags.libFuzzer], - ), JobNames.BUILD_CHECK: CommonJobConfigs.BUILD_REPORT.with_properties(), JobNames.INSTALL_TEST_AMD: CommonJobConfigs.INSTALL_TEST.with_properties( required_builds=[BuildNames.PACKAGE_RELEASE] From c9ffcb0ef11fa7ff43712350efcac6f6e2337b3b Mon Sep 17 00:00:00 2001 From: Yakov Olkhovskiy Date: Thu, 21 Nov 2024 03:00:16 +0000 Subject: [PATCH 5/8] fix --- tests/ci/ci_config.py | 2 +- tests/ci/ci_definitions.py | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/ci/ci_config.py b/tests/ci/ci_config.py index adb0881ecd5..d0f62b5d770 100644 --- a/tests/ci/ci_config.py +++ b/tests/ci/ci_config.py @@ -272,7 +272,7 @@ class CI: ), BuildNames.FUZZERS: CommonJobConfigs.BUILD.with_properties( build_config=BuildConfig( - name=BuildNames.FUZZERS_ASAN, + name=BuildNames.FUZZERS, compiler="clang-18", sanitizer="address", package_type="fuzzers", diff --git a/tests/ci/ci_definitions.py b/tests/ci/ci_definitions.py index ad15d692944..d55e347c3ee 100644 --- a/tests/ci/ci_definitions.py +++ b/tests/ci/ci_definitions.py @@ -123,10 +123,6 @@ class BuildNames(metaclass=WithIter): BINARY_S390X = "binary_s390x" BINARY_LOONGARCH64 = "binary_loongarch64" FUZZERS = "fuzzers" - FUZZERS_ASAN = "fuzzers_asan" - FUZZERS_UBSAN = "fuzzers_ubsan" - FUZZERS_TSAN = "fuzzers_tsan" - FUZZERS_MSAN = "fuzzers_msan" class JobNames(metaclass=WithIter): From bfafaf93dcc7429093566457c3a1a8586f189039 Mon Sep 17 00:00:00 2001 From: Yakov Olkhovskiy Date: Thu, 21 Nov 2024 03:17:01 +0000 Subject: [PATCH 6/8] trigger build From 52ab45b6eecdc2b547005dd73a07083593c141cc Mon Sep 17 00:00:00 2001 From: Yakov Olkhovskiy Date: Thu, 21 Nov 2024 03:29:56 +0000 Subject: [PATCH 7/8] trigger build --- src/DataTypes/fuzzers/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/DataTypes/fuzzers/CMakeLists.txt b/src/DataTypes/fuzzers/CMakeLists.txt index 8940586fc70..8dedd3470e2 100644 --- a/src/DataTypes/fuzzers/CMakeLists.txt +++ b/src/DataTypes/fuzzers/CMakeLists.txt @@ -1,3 +1,2 @@ clickhouse_add_executable(data_type_deserialization_fuzzer data_type_deserialization_fuzzer.cpp ${SRCS}) - target_link_libraries(data_type_deserialization_fuzzer PRIVATE clickhouse_aggregate_functions dbms) From 163f2b11215f0e57fecb802415300485dd56b512 Mon Sep 17 00:00:00 2001 From: Yakov Olkhovskiy Date: Thu, 21 Nov 2024 05:57:12 +0000 Subject: [PATCH 8/8] run time to 5 min per test --- tests/ci/libfuzzer_test_check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ci/libfuzzer_test_check.py b/tests/ci/libfuzzer_test_check.py index 6783f5c1613..003a256f18c 100644 --- a/tests/ci/libfuzzer_test_check.py +++ b/tests/ci/libfuzzer_test_check.py @@ -21,7 +21,7 @@ from s3_helper import S3Helper from stopwatch import Stopwatch from tee_popen import TeePopen -TIMEOUT = 60 +TIMEOUT = 60 * 5 NO_CHANGES_MSG = "Nothing to run" s3 = S3Helper()