Skip to content

Commit cdc77a2

Browse files
committed
test: Fix announcement address assertion and simplify stress test
Read node_b's listening addresses from the node after setup instead of using the pre-retry variable, which may differ if setup_node retried with new ports. Simplify the stress test to run 1 process per shard with 10 iterations instead of 3 concurrent processes. The concurrent processes caused port collisions in code paths outside setup_node that don't have retry logic, which is noise unrelated to the electrs crash we're investigating. AI tools were used in preparing this commit.
1 parent d9a1f97 commit cdc77a2

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

.github/workflows/rust.yml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -130,29 +130,18 @@ jobs:
130130
echo "ELECTRS_EXE=$( pwd )/bin/electrs-${{ runner.os }}-${{ runner.arch }}" >> "$GITHUB_ENV"
131131
- name: Build integration tests
132132
run: RUSTFLAGS="--cfg no_download --cfg cycle_tests" cargo test --test integration_tests_rust --no-run
133-
- name: Stress-test integration tests (5 iterations, 3 concurrent processes)
133+
- name: Stress-test integration tests (10 iterations)
134134
run: |
135-
for i in $(seq 1 5); do
135+
for i in $(seq 1 10); do
136136
echo "=== Iteration $i (shard ${{ matrix.shard }}) ==="
137-
for j in 1 2 3; do
138-
RUSTFLAGS="--cfg no_download --cfg cycle_tests" cargo test --test integration_tests_rust -- --nocapture > /tmp/stress-${j}.log 2>&1 &
139-
pids[${j}]=$!
140-
done
141-
failed=0
142-
for j in 1 2 3; do
143-
if ! wait ${pids[${j}]}; then
144-
echo "FAILED: process $j on iteration $i (shard ${{ matrix.shard }})"
145-
cat /tmp/stress-${j}.log
146-
failed=1
147-
fi
148-
done
149-
if [ $failed -eq 1 ]; then
137+
RUSTFLAGS="--cfg no_download --cfg cycle_tests" cargo test --test integration_tests_rust -- --nocapture 2>&1 || {
138+
echo "FAILED on iteration $i (shard ${{ matrix.shard }})"
150139
echo "=== dmesg OOM/kill messages ==="
151140
sudo dmesg | grep -iE 'oom|kill|out of memory|invoked oom' || echo "No OOM messages found"
152141
echo "=== dmesg last 50 lines ==="
153142
sudo dmesg | tail -50
154143
exit 1
155-
fi
144+
}
156145
done
157146
158147
doc:

tests/integration_tests_rust.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,13 +1443,12 @@ async fn test_node_announcement_propagation() {
14431443
node_b_alias_bytes[..node_b_alias_string.as_bytes().len()]
14441444
.copy_from_slice(node_b_alias_string.as_bytes());
14451445
let node_b_node_alias = Some(NodeAlias(node_b_alias_bytes));
1446-
let node_b_listening_addresses = random_listening_addresses();
14471446
config_b.node_config.node_alias = node_b_node_alias.clone();
1448-
config_b.node_config.listening_addresses = Some(node_b_listening_addresses.clone());
14491447
config_b.node_config.announcement_addresses = None;
14501448

14511449
let node_a = setup_node(&chain_source, config_a);
14521450
let node_b = setup_node(&chain_source, config_b);
1451+
let node_b_listening_addresses = node_b.listening_addresses().unwrap();
14531452

14541453
let address_a = node_a.onchain_payment().new_address().unwrap();
14551454
let premine_amount_sat = 5_000_000;

0 commit comments

Comments
 (0)