@@ -291,7 +291,7 @@ async fn probe_budget_increments_and_decrements() {
291291 tokio:: time:: sleep ( Duration :: from_secs ( 3 ) ) . await ;
292292 strategy. start_probing ( ) ;
293293
294- let went_up = tokio:: time:: timeout ( Duration :: from_secs ( 10 ) , async {
294+ let went_up = tokio:: time:: timeout ( Duration :: from_secs ( 30 ) , async {
295295 loop {
296296 if node_a. prober ( ) . map_or ( 0 , |p| p. locked_msat ( ) ) > 0 {
297297 break ;
@@ -304,7 +304,7 @@ async fn probe_budget_increments_and_decrements() {
304304 assert ! ( went_up, "locked_msat never increased — no probe was dispatched" ) ;
305305 println ! ( "First probe dispatched; locked_msat = {}" , node_a. prober( ) . unwrap( ) . locked_msat( ) ) ;
306306
307- let cleared = tokio:: time:: timeout ( Duration :: from_secs ( 20 ) , async {
307+ let cleared = tokio:: time:: timeout ( Duration :: from_secs ( 30 ) , async {
308308 loop {
309309 if node_a. prober ( ) . map_or ( 1 , |p| p. locked_msat ( ) ) == 0 {
310310 break ;
@@ -315,7 +315,6 @@ async fn probe_budget_increments_and_decrements() {
315315 . await
316316 . is_ok ( ) ;
317317 assert ! ( cleared, "locked_msat never returned to zero after probe resolved" ) ;
318- println ! ( "Probe resolved; locked_msat = 0" ) ;
319318
320319 node_a. stop ( ) . unwrap ( ) ;
321320 node_b. stop ( ) . unwrap ( ) ;
@@ -335,12 +334,11 @@ async fn exhausted_probe_budget_blocks_new_probes() {
335334 let node_b = setup_node ( & chain_source, random_config ( false ) ) ;
336335 let node_c = setup_node ( & chain_source, random_config ( false ) ) ;
337336
338- // Use a slow probing interval so we can read capacity before the first probe fires.
339337 let mut config_a = random_config ( false ) ;
340338 let strategy = FixedDestStrategy :: new ( node_c. node_id ( ) , PROBE_AMOUNT_MSAT ) ;
341339 config_a. probing = Some (
342340 ProbingConfig :: custom ( strategy. clone ( ) )
343- . interval ( Duration :: from_secs ( 10 ) )
341+ . interval ( Duration :: from_millis ( PROBING_INTERVAL_MILLISECONDS ) )
344342 . max_locked_msat ( PROBE_AMOUNT_MSAT )
345343 . build ( ) ,
346344 ) ;
@@ -373,7 +371,6 @@ async fn exhausted_probe_budget_blocks_new_probes() {
373371 expect_event ! ( node_b, ChannelReady ) ;
374372 expect_event ! ( node_c, ChannelReady ) ;
375373
376- // Record capacity before the first probe fires (interval is 3s, so we have time).
377374 let capacity_at_open = node_a
378375 . list_channels ( )
379376 . iter ( )
@@ -382,10 +379,12 @@ async fn exhausted_probe_budget_blocks_new_probes() {
382379 . expect ( "A→B channel not found" ) ;
383380
384381 assert_eq ! ( node_a. prober( ) . map_or( 1 , |p| p. locked_msat( ) ) , 0 , "initial locked_msat is nonzero" ) ;
382+
383+ tokio:: time:: sleep ( Duration :: from_secs ( 3 ) ) . await ;
385384 strategy. start_probing ( ) ;
386385
387- // Give gossip time to propagate to A, then wait for the first probe.
388- let locked = tokio:: time:: timeout ( Duration :: from_secs ( 15 ) , async {
386+ // Wait for the first probe to be in-flight .
387+ let locked = tokio:: time:: timeout ( Duration :: from_secs ( 30 ) , async {
389388 loop {
390389 if node_a. prober ( ) . map_or ( 0 , |p| p. locked_msat ( ) ) > 0 {
391390 break ;
@@ -395,7 +394,7 @@ async fn exhausted_probe_budget_blocks_new_probes() {
395394 } )
396395 . await
397396 . is_ok ( ) ;
398- assert ! ( locked, "no probe dispatched within 15 s" ) ;
397+ assert ! ( locked, "no probe dispatched within 30 s" ) ;
399398
400399 // Capacity should have decreased due to the in-flight probe HTLC.
401400 let capacity_with_probe = node_a
@@ -412,8 +411,6 @@ async fn exhausted_probe_budget_blocks_new_probes() {
412411 // Stop B while the probe HTLC is in-flight.
413412 node_b. stop ( ) . unwrap ( ) ;
414413
415- // Let several Prober ticks fire (interval is 3s); the budget is exhausted so
416- // they must be skipped. Wait, then check both conditions at once.
417414 tokio:: time:: sleep ( Duration :: from_secs ( 5 ) ) . await ;
418415 assert ! (
419416 node_a. prober( ) . map_or( 0 , |p| p. locked_msat( ) ) > 0 ,
@@ -438,7 +435,7 @@ async fn exhausted_probe_budget_blocks_new_probes() {
438435 node_b. connect ( node_a. node_id ( ) , node_a_addr, false ) . unwrap ( ) ;
439436 node_b. connect ( node_c. node_id ( ) , node_c_addr, false ) . unwrap ( ) ;
440437
441- let cleared = tokio:: time:: timeout ( Duration :: from_secs ( 15 ) , async {
438+ let cleared = tokio:: time:: timeout ( Duration :: from_secs ( 30 ) , async {
442439 loop {
443440 if node_a. prober ( ) . map_or ( 1 , |p| p. locked_msat ( ) ) == 0 {
444441 break ;
@@ -451,7 +448,7 @@ async fn exhausted_probe_budget_blocks_new_probes() {
451448 assert ! ( cleared, "locked_msat never cleared after B came back online" ) ;
452449
453450 // Once the budget is freed, a new probe should be dispatched within a few ticks.
454- let new_probe = tokio:: time:: timeout ( Duration :: from_secs ( 10 ) , async {
451+ let new_probe = tokio:: time:: timeout ( Duration :: from_secs ( 30 ) , async {
455452 loop {
456453 if node_a. prober ( ) . map_or ( 0 , |p| p. locked_msat ( ) ) > 0 {
457454 break ;
0 commit comments