FrankChen021 commented on code in PR #20560:
URL: https://github.com/apache/druid/pull/20560#discussion_r4272217352


##########
.github/scripts/run-stability:
##########
@@ -0,0 +1,69 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Usage: run-stability <maven arguments...>
+
+set -e
+
+if [ "$#" -eq 0 ]; then
+    echo "Usage: $0 <maven arguments...>" >&2
+    exit 1
+fi
+ARGS=("$@")
+
+set -x
+
+RUNS=8
+
+OPTS="-Pci,skip-static-checks -Dweb.console.skip=true"
+OPTS+=" -B -Dmaven.test.failure.ignore=true"
+OPTS+=" -Dorg.slf4j.simpleLogger.defaultLogLevel=warn"
+OPTS+=" -Dorg.slf4j.simpleLogger.log.org.apache.maven.plugin.surefire=info"
+OPTS+=" -Dsurefire.rerunFailingTestsCount=0"
+
+TASK_LOGS="$(pwd)/task-logs"
+RESULTS="stability-results"
+
+# Expand per-run archives at EXIT so they are directly accessible after run
+expand_archives() {
+    shopt -s nullglob
+    for archive in "$RESULTS"/run*.tar; do
+        dir="${archive%.tar}"
+        mkdir -p "$dir"
+        tar -xf "$archive" -C "$dir" && rm "$archive"
+    done
+    shopt -u nullglob
+}
+trap expand_archives EXIT
+
+# Build the module under test and its dependencies without running tests.
+mvn -am -DskipTests $OPTS "${ARGS[@]}" install
+
+for i in $(seq 1 "$RUNS"); do
+    echo "=== Stability run ${i}/${RUNS} ==="
+
+    mkdir -p "$TASK_LOGS"
+    mvn $OPTS "-Dtask.logs.dir=${TASK_LOGS}" "${ARGS[@]}" test
+
+    mkdir -p "$RESULTS"
+
+    # Archive matched paths into a per-run tarball - will be expanded on exit
+    shopt -s globstar nullglob
+    tar -cf "$RESULTS/run${i}.tar" --remove-files **/target/surefire-reports 
task-logs

Review Comment:
   [P1] Surefire reports are removed before the JUnit gate
   
   **Finding:** Because maven.test.failure.ignore=true makes failed test 
executions exit successfully, the worker's JUnit report action is the remaining 
failure gate. This command recursively archives the target/surefire-reports 
trees with --remove-files after each run, so by the time worker.yml evaluates 
hashFiles('**/TEST-*.xml'), reports from all eight runs are gone; the report 
step is skipped and a shard can be green after a test failure.
   
   **Suggestion:** Preserve or aggregate each run's TEST-*.xml files for the 
worker's JUnit action, or invoke the failure and annotation step before 
deleting them while retaining per-run archives for artifacts.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to