-
Notifications
You must be signed in to change notification settings - Fork 470
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
97 additions
and
293 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: 'Debug Script' | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- master | ||
- gh-pages | ||
pull_request: | ||
merge_group: | ||
|
||
# https://stackoverflow.com/a/72408109/16358266 | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-and-verify: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
variant: ['3.0', '4.0'] | ||
java: ['21', '22'] | ||
os: ['ubuntu-latest', 'windows-latest', 'macos-latest'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
# Codecov needs fetch-depth > 1 | ||
fetch-depth: 2 | ||
- name: 'Set up JDKs' | ||
uses: ./.github/actions/setup-build-env | ||
with: | ||
additional-java-version: ${{ matrix.java }} | ||
- name: 'Build Spock' | ||
# secrets are not injected for pull requests | ||
env: | ||
DEVELOCITY_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
run: ./repeatUntilFailure.sh ./gradlew --stacktrace :spock-specs:test --rerun "-Dvariant=${{ matrix.variant }}" "-DjavaVersion=${{ matrix.java }}" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
|
||
# Ensure that a command is provided as an argument | ||
if [ $# -eq 0 ]; then | ||
echo "No command provided. Usage: ./run_until_fail.sh <command>" | ||
exit 1 | ||
fi | ||
|
||
# Command to run (passed as script arguments) | ||
COMMAND="$@" | ||
MAX_RETRIES=10 # Set the maximum number of retries | ||
COUNTER=0 # Initialize the retry counter | ||
CHECK_INTERVAL=5 # Interval in seconds to check if the command is still running | ||
|
||
while [ $COUNTER -lt $MAX_RETRIES ]; do | ||
# Increment the retry counter | ||
COUNTER=$((COUNTER + 1)) | ||
echo "Attempt $COUNTER of $MAX_RETRIES..." | ||
|
||
# Start the command in the background | ||
bash -c "$COMMAND" & | ||
COMMAND_PID=$! | ||
|
||
# Track elapsed time | ||
ELAPSED_TIME=0 | ||
|
||
# Check periodically if the command has completed | ||
while ps -p $COMMAND_PID > /dev/null; do | ||
sleep $CHECK_INTERVAL | ||
ELAPSED_TIME=$((ELAPSED_TIME + CHECK_INTERVAL)) | ||
|
||
if [ $ELAPSED_TIME -ge 60 ]; then | ||
echo "Warning: The command has been running for more than 1 minute." | ||
|
||
# Run the jcmd command to print thread information | ||
jcmd $(jps -v | grep SpockTestConfig.groovy | awk '{print $1}') Thread.print | ||
|
||
# Wait for the command to complete | ||
wait $COMMAND_PID | ||
break | ||
fi | ||
done | ||
|
||
# Capture the exit status | ||
wait $COMMAND_PID | ||
STATUS=$? | ||
|
||
# Check if the command failed | ||
if [ $STATUS -ne 0 ]; then | ||
echo "The command failed with exit status $STATUS. Exiting loop." | ||
break | ||
fi | ||
|
||
# Check if the retry limit has been reached | ||
if [ $COUNTER -ge $MAX_RETRIES ]; then | ||
echo "Reached the maximum number of retries ($MAX_RETRIES). Exiting." | ||
break | ||
fi | ||
done |