diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a4b4fdb236..a846cb7a56 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1312,6 +1312,35 @@ unit:clang:tsan: - job: clang:tsan artifacts: true +generate-tsan-stress-test-configs: + <<: *base_image + <<: *default_triggering_rules + stage: system + script: + - util/generate-tsan-stress-jobs.py > tsan-stress-test-configs.yml + artifacts: + paths: + - tsan-stress-test-configs.yml + needs: [] + when: manual + +tsan:stress: + <<: *default_triggering_rules + stage: postcheck + variables: + PARENT_PIPELINE_ID: $CI_PIPELINE_ID + trigger: + include: + - artifact: tsan-stress-test-configs.yml + job: generate-tsan-stress-test-configs + needs: + - job: generate-tsan-stress-test-configs + artifacts: true + - job: gcc:tsan + artifacts: true + - job: clang:tsan + artifacts: true + # Jobs for Clang builds on Debian 12 "bookworm" (amd64) clang:bookworm:amd64: diff --git a/util/generate-tsan-stress-jobs.py b/util/generate-tsan-stress-jobs.py new file mode 100755 index 0000000000..f0c57f8bba --- /dev/null +++ b/util/generate-tsan-stress-jobs.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python3 + +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +import yaml + +NUMBER_OF_TESTS_PER_TSAN_JOB = 50 + +with open(".gitlab-ci.yml", encoding="utf-8") as gitlab_ci_yml: + anchors = yaml.load(gitlab_ci_yml, Loader=yaml.Loader) + +for tsan_job in "gcc:tsan", "clang:tsan": + tsan_stress_test_job = anchors[f"system:{tsan_job}"] + tsan_stress_test_job["stage"] = "test" + tsan_stress_test_job["rules"] = [{"if": '$CI_PIPELINE_SOURCE == "parent_pipeline"'}] + tsan_stress_test_job["parallel"] = NUMBER_OF_TESTS_PER_TSAN_JOB + tsan_stress_test_job["needs"] = [ + {"pipeline": "$PARENT_PIPELINE_ID", "job": tsan_job} + ] + del tsan_stress_test_job["only"] + + print( + yaml.dump( + {f"system:{tsan_job}:stress": tsan_stress_test_job}, + Dumper=yaml.Dumper, + ) + )