Merge pull request #23522 from opf/retry-failing-specs

retry failing feature specs if there are <= 10
This commit is contained in:
Ivan Kuchin
2026-06-09 21:03:17 +02:00
committed by GitHub
+17 -2
View File
@@ -1,5 +1,6 @@
#!/bin/bash
set -e
set -eo pipefail
export PATH="/usr/lib/postgresql/$PGVERSION/bin:$PATH"
export JOBS="${CI_JOBS:=$(nproc)}"
@@ -166,7 +167,21 @@ run_features() {
shopt -s globstar nullglob
run_background start_hocuspocus
reset_dbs
execute "time bundle exec turbo_tests --verbose -n $JOBS --runtime-log spec/support/runtime-logs/turbo_runtime_features.log {,modules/*/}spec/features/**/*_spec.rb"
if ! execute "time bundle exec turbo_tests --verbose -n $JOBS --runtime-log spec/support/runtime-logs/turbo_runtime_features.log {,modules/*/}spec/features/**/*_spec.rb"; then
failed_count=$(grep --count ' failed ' tmp/spec_examples.txt 2>/dev/null || echo 0)
if [ "$failed_count" -eq 0 ]; then
echo "failed to find failing examples, unexpected"
exit 1
elif [ "$failed_count" -le 10 ]; then
echo "retrying $failed_count failed examples"
execute "bundle exec rspec --only-failures --format documentation {,modules/*/}spec/features/**/*_spec.rb"
else
echo "too many failures ($failed_count), not retrying"
exit 1
fi
fi
cleanup
}