]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Generate TSAN stress test
authorMichal Nowak <mnowak@isc.org>
Fri, 16 Aug 2024 16:13:46 +0000 (18:13 +0200)
committerMichal Nowak <mnowak@isc.org>
Wed, 28 Aug 2024 09:01:11 +0000 (11:01 +0200)
.gitlab-ci.yml
util/generate-tsan-stress-jobs.py [new file with mode: 0755]

index a4b4fdb236ad6c980cc535f5c2dc70c62032857e..a846cb7a568cd6b7b736c4cfff2a7fa865d341c9 100644 (file)
@@ -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 (executable)
index 0000000..f0c57f8
--- /dev/null
@@ -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,
+        )
+    )