From c8a409d15ebe55becb6475040b93f92263f8185b Mon Sep 17 00:00:00 2001 From: Leo Nash Date: Thu, 20 Aug 2026 14:34:03 +0000 Subject: [PATCH] Stabilize the connection restart test Give a few seconds for the connection to occur before asserting on it. Also verify the inbound peer's connected flag instead of rechecking the outbound peer. Co-Authored-By: HAL 9000 --- tests/integration_tests_rust.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/integration_tests_rust.rs b/tests/integration_tests_rust.rs index fd247f74c..8c483a494 100644 --- a/tests/integration_tests_rust.rs +++ b/tests/integration_tests_rust.rs @@ -1899,10 +1899,13 @@ async fn do_connection_restart_behavior(persist: bool) { assert_eq!(peer_details_a.is_persisted, persist); assert!(peer_details_a.is_connected); + // Sleep a bit to allow for the connection to happen. + tokio::time::sleep(std::time::Duration::from_secs(5)).await; + let peer_details_b = node_b.list_peers().first().unwrap().clone(); assert_eq!(peer_details_b.node_id, node_id_a); assert_eq!(peer_details_b.is_persisted, false); - assert!(peer_details_a.is_connected); + assert!(peer_details_b.is_connected); // Restart nodes. node_a.stop().unwrap();