Skip to content

Commit 163569b

Browse files
committed
ci: Add stress-test job to reproduce intermittent electrs failures
Run integration tests 10 times in a loop with --nocapture to maximize the chance of hitting the intermittent electrs crash and to capture the new diagnostic logging output. AI tools were used in preparing this commit.
1 parent 33927c3 commit 163569b

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/rust.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,46 @@ jobs:
8686
run: |
8787
RUSTFLAGS="--cfg no_download --cfg cycle_tests" cargo test --features uniffi
8888
89+
stress-test:
90+
runs-on: ubuntu-latest
91+
steps:
92+
- name: Checkout source code
93+
uses: actions/checkout@v3
94+
- name: Install Rust stable toolchain
95+
run: |
96+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain stable
97+
- name: Enable caching for bitcoind
98+
id: cache-bitcoind
99+
uses: actions/cache@v4
100+
with:
101+
path: bin/bitcoind-${{ runner.os }}-${{ runner.arch }}
102+
key: bitcoind-${{ runner.os }}-${{ runner.arch }}
103+
- name: Enable caching for electrs
104+
id: cache-electrs
105+
uses: actions/cache@v4
106+
with:
107+
path: bin/electrs-${{ runner.os }}-${{ runner.arch }}
108+
key: electrs-${{ runner.os }}-${{ runner.arch }}
109+
- name: Download bitcoind/electrs
110+
if: "steps.cache-bitcoind.outputs.cache-hit != 'true' || steps.cache-electrs.outputs.cache-hit != 'true'"
111+
run: |
112+
source ./scripts/download_bitcoind_electrs.sh
113+
mkdir bin
114+
mv "$BITCOIND_EXE" bin/bitcoind-${{ runner.os }}-${{ runner.arch }}
115+
mv "$ELECTRS_EXE" bin/electrs-${{ runner.os }}-${{ runner.arch }}
116+
- name: Set bitcoind/electrs environment variables
117+
run: |
118+
echo "BITCOIND_EXE=$( pwd )/bin/bitcoind-${{ runner.os }}-${{ runner.arch }}" >> "$GITHUB_ENV"
119+
echo "ELECTRS_EXE=$( pwd )/bin/electrs-${{ runner.os }}-${{ runner.arch }}" >> "$GITHUB_ENV"
120+
- name: Build integration tests
121+
run: RUSTFLAGS="--cfg no_download --cfg cycle_tests" cargo test --test integration_tests_rust --no-run
122+
- name: Stress-test integration tests (10 iterations)
123+
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; }
127+
done
128+
89129
doc:
90130
name: Documentation
91131
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)