diff --git a/.github/assets/hive/run_experimental_simulator.sh b/.github/assets/hive/run_experimental_simulator.sh new file mode 100755 index 000000000000..597e3d2f0956 --- /dev/null +++ b/.github/assets/hive/run_experimental_simulator.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# set -x + +cd hivetests/ + +sim="${1}" +limit="${2}" + +run_hive() { + sed -ie 's/RUST_LOG=info $reth node $FLAGS/RUST_LOG=info $reth node --engine.experimental $FLAGS/' clients/reth/reth.sh + hive --sim "${sim}" --sim.limit "${limit}" --sim.parallelism 4 --client reth 2>&1 | tee /tmp/log || true +} + +check_log() { + tail -n 1 /tmp/log | sed -r 's/\x1B\[[0-9;]*[mK]//g' +} + +attempt=0 +max_attempts=5 + +while [ $attempt -lt $max_attempts ]; do + run_hive + + # Check if no tests were run. sed removes ansi colors + if check_log | grep -q "suites=0"; then + echo "no tests were run, retrying in 10 seconds" + sleep 10 + attempt=$((attempt + 1)) + continue + fi + + # Check the last line of the log for "finished", "tests failed", or "test failed" + if check_log | grep -Eq "(finished|tests? failed)"; then + exit 0 + else + exit 1 + fi +done +exit 1 diff --git a/.github/assets/hive/run_simulator.sh b/.github/assets/hive/run_simulator.sh index 597e3d2f0956..731c94c3f69b 100755 --- a/.github/assets/hive/run_simulator.sh +++ b/.github/assets/hive/run_simulator.sh @@ -7,7 +7,6 @@ sim="${1}" limit="${2}" run_hive() { - sed -ie 's/RUST_LOG=info $reth node $FLAGS/RUST_LOG=info $reth node --engine.experimental $FLAGS/' clients/reth/reth.sh hive --sim "${sim}" --sim.limit "${limit}" --sim.parallelism 4 --client reth 2>&1 | tee /tmp/log || true } diff --git a/.github/workflows/hive-experimental.yml b/.github/workflows/hive-experimental.yml index 921ca19b8c70..36a540caf47d 100644 --- a/.github/workflows/hive-experimental.yml +++ b/.github/workflows/hive-experimental.yml @@ -216,7 +216,7 @@ jobs: path: hivetests - name: Run ${{ matrix.sim }} simulator - run: .github/assets/hive/run_simulator.sh "${{ matrix.sim }}$" "${{matrix.limit}}/${{join(matrix.include, '|')}}" + run: .github/assets/hive/run_experimental_simulator.sh "${{ matrix.sim }}$" "${{matrix.limit}}/${{join(matrix.include, '|')}}" - name: Parse hive output run: |