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


##########
.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:
   Follow-up review: I reviewed 9 of 9 changed files. I’m withdrawing this 
specific finding after rechecking the current head: `run-stability` archives 
the Surefire reports during each loop, but its `EXIT` trap expands each 
`run<N>.tar` into `stability-results/run<N>/` before the worker proceeds. Those 
restored XML files still match `hashFiles('**/TEST-*.xml')`, and the worker’s 
`fail_on_failure: true` gate can fail the shard on a test failure. The task 
logs remain in the per-run artifacts.
   
   ---
   
   This is an automated review by Codex GPT-5.6-Luna(max)
   
   <!-- mergelens:review -->



-- 
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