Skip to content

Commit 6de9312

Browse files
committed
ci: Run 3 concurrent test processes across 3 stress-test shards
Increase resource pressure to reproduce intermittent electrs failures. Each of the 3 shards runs 5 iterations with 3 concurrent cargo test processes, for 45 total test runs with up to 9 simultaneous processes. AI tools were used in preparing this commit.
1 parent 163569b commit 6de9312

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

.github/workflows/rust.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ jobs:
8787
RUSTFLAGS="--cfg no_download --cfg cycle_tests" cargo test --features uniffi
8888
8989
stress-test:
90+
strategy:
91+
fail-fast: false
92+
matrix:
93+
shard: [1, 2, 3]
9094
runs-on: ubuntu-latest
9195
steps:
9296
- name: Checkout source code
@@ -119,11 +123,21 @@ jobs:
119123
echo "ELECTRS_EXE=$( pwd )/bin/electrs-${{ runner.os }}-${{ runner.arch }}" >> "$GITHUB_ENV"
120124
- name: Build integration tests
121125
run: RUSTFLAGS="--cfg no_download --cfg cycle_tests" cargo test --test integration_tests_rust --no-run
122-
- name: Stress-test integration tests (10 iterations)
126+
- name: Stress-test integration tests (5 iterations, 3 concurrent processes)
123127
run: |
124-
for i in $(seq 1 10); do
125-
echo "=== Iteration $i ==="
126-
RUSTFLAGS="--cfg no_download --cfg cycle_tests" cargo test --test integration_tests_rust -- --nocapture 2>&1 || { echo "FAILED on iteration $i"; exit 1; }
128+
for i in $(seq 1 5); do
129+
echo "=== Iteration $i (shard ${{ matrix.shard }}) ==="
130+
for j in 1 2 3; do
131+
RUSTFLAGS="--cfg no_download --cfg cycle_tests" cargo test --test integration_tests_rust -- --nocapture > /tmp/stress-${j}.log 2>&1 &
132+
pids[${j}]=$!
133+
done
134+
for j in 1 2 3; do
135+
if ! wait ${pids[${j}]}; then
136+
echo "FAILED: process $j on iteration $i (shard ${{ matrix.shard }})"
137+
cat /tmp/stress-${j}.log
138+
exit 1
139+
fi
140+
done
127141
done
128142
129143
doc:

0 commit comments

Comments
 (0)