Skip to content

Commit c3d182d

Browse files
committed
Stabilize probing restart test
Wait for monitor persistence and queued probe failures to settle before accepting an in-flight probe for the restart assertion. This prevents transient locked amounts from failing the test under CI load. Co-Authored-By: HAL 9000
1 parent 1cc60c8 commit c3d182d

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tests/probing_tests.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,9 @@ async fn locked_msat_accounts_for_routing_fees() {
296296
/// HTLC pending across the restart we observe `locked_msat > 0` and then *immediately*
297297
/// call `node_a.disconnect(node_b)`, which closes A's socket to B in-process — much
298298
/// faster than `node_b.stop()` — so any failure message from B is dropped before A
299-
/// processes it. If the race is lost on a given probe (locked_msat drops back to 0
300-
/// after the disconnect), we reconnect and let the next probe tick try again.
299+
/// processes it. Before rechecking, we allow monitor persistence and queued failure
300+
/// handling to settle. If the race is lost on a given probe (locked_msat drops back to
301+
/// 0 after the disconnect), we reconnect and let the next probe tick try again.
301302
/// The pending Probe entry persists in `node_a`'s channel manager and must be
302303
/// rebuilt by the prober's `locked_msat` on restart via `list_recent_payments()`.
303304
#[tokio::test(flavor = "multi_thread")]
@@ -363,11 +364,14 @@ async fn probing_budget_restored_after_node_restart() {
363364
let isolated = tokio::time::timeout(Duration::from_secs(30), async {
364365
loop {
365366
if node_a.prober().unwrap().locked_msat() > 0 {
367+
strategy.stop_probing();
366368
node_a.disconnect(node_b_id).ok();
369+
tokio::time::sleep(Duration::from_secs(1)).await;
367370
if node_a.prober().unwrap().locked_msat() > 0 {
368371
return true;
369372
}
370373
node_a.connect(node_b_id, node_b_addr.clone(), false).ok();
374+
strategy.start_probing();
371375
}
372376
tokio::time::sleep(Duration::from_millis(1)).await;
373377
}

0 commit comments

Comments
 (0)