@@ -133,6 +133,7 @@ async fn run_blocked_peers_test(config: BlockedPeersConfig) -> TestResult {
133133 let path = preset. temp_dir . path ( ) . to_path_buf ( ) ;
134134 ( cfg, preset, gw_config_from_path ( public_port, & path) ?)
135135 } ;
136+
136137 let ws_api_port_gw = config_gw. ws_api . ws_api_port . unwrap ( ) ;
137138
138139 // Configure Node1 (blocks Node2)
@@ -167,7 +168,7 @@ async fn run_blocked_peers_test(config: BlockedPeersConfig) -> TestResult {
167168 tracing:: info!( "Node 1 blocks: {:?}" , node2_network_addr) ;
168169 tracing:: info!( "Node 2 blocks: {:?}" , node1_network_addr) ;
169170
170- // Free socket resources
171+ // Free socket resources before starting nodes
171172 std:: mem:: drop ( network_socket_gw) ;
172173 std:: mem:: drop ( ws_api_port_socket_gw) ;
173174 std:: mem:: drop ( network_socket_node1) ;
@@ -788,17 +789,16 @@ async fn run_blocked_peers_test(config: BlockedPeersConfig) -> TestResult {
788789
789790/// Standard blocked peers test (baseline)
790791#[ test_log:: test( tokio:: test( flavor = "multi_thread" ) ) ]
791- #[ ignore]
792792async fn test_ping_blocked_peers ( ) -> TestResult {
793793 run_blocked_peers_test ( BlockedPeersConfig {
794794 test_name : "baseline" ,
795- initial_wait : Duration :: from_secs ( 10 ) ,
796- operation_timeout : Duration :: from_secs ( 20 ) ,
795+ initial_wait : Duration :: from_secs ( 25 ) ,
796+ operation_timeout : Duration :: from_secs ( 45 ) ,
797797 update_rounds : 3 ,
798798 update_wait : Duration :: from_secs ( 5 ) ,
799- propagation_wait : Duration :: from_secs ( 8 ) ,
799+ propagation_wait : Duration :: from_secs ( 15 ) ,
800800 verbose_logging : false ,
801- check_interval : None ,
801+ check_interval : Some ( Duration :: from_secs ( 4 ) ) ,
802802 send_refresh_updates : false ,
803803 send_final_updates : true ,
804804 subscribe_immediately : false ,
@@ -808,44 +808,39 @@ async fn test_ping_blocked_peers() -> TestResult {
808808
809809/// Simple blocked peers test
810810#[ test_log:: test( tokio:: test( flavor = "multi_thread" ) ) ]
811- #[ ignore]
812811async fn test_ping_blocked_peers_simple ( ) -> TestResult {
813812 run_blocked_peers_test ( BlockedPeersConfig {
814813 test_name : "simple" ,
815- initial_wait : Duration :: from_secs ( 10 ) ,
816- operation_timeout : Duration :: from_secs ( 15 ) ,
817- update_rounds : 1 , // Only one round of updates
818- update_wait : Duration :: from_secs ( 3 ) ,
819- propagation_wait : Duration :: from_secs ( 10 ) , // Longer wait for simpler flow
814+ initial_wait : Duration :: from_secs ( 25 ) ,
815+ operation_timeout : Duration :: from_secs ( 45 ) ,
816+ update_rounds : 1 ,
817+ update_wait : Duration :: from_secs ( 5 ) ,
818+ propagation_wait : Duration :: from_secs ( 15 ) ,
820819 verbose_logging : false ,
821- check_interval : None ,
820+ check_interval : Some ( Duration :: from_secs ( 4 ) ) ,
822821 send_refresh_updates : false ,
823822 send_final_updates : false ,
824- subscribe_immediately : true ,
823+ subscribe_immediately : false ,
825824 } )
826825 . await
827826}
828827
829- // Note: Redundant tests (optimized, improved, debug, reliable) were removed
830- // as they only varied in non-functional aspects like timeouts and logging
831-
832828/// Solution/reference implementation for blocked peers
833829// TODO-MUST-FIX: WebSocket connection reset during teardown - see issue #2108
834830// Test passes functionally (PUT/GET/Subscribe/state propagation all work) but
835831// fails with "Connection reset without closing handshake" during cleanup.
836832// Likely a test teardown race rather than functional bug.
837833#[ test_log:: test( tokio:: test( flavor = "multi_thread" ) ) ]
838- #[ ignore]
839834async fn test_ping_blocked_peers_solution ( ) -> TestResult {
840835 run_blocked_peers_test ( BlockedPeersConfig {
841836 test_name : "solution" ,
842- initial_wait : Duration :: from_secs ( 12 ) ,
843- operation_timeout : Duration :: from_secs ( 25 ) ,
837+ initial_wait : Duration :: from_secs ( 25 ) ,
838+ operation_timeout : Duration :: from_secs ( 60 ) ,
844839 update_rounds : 2 ,
845- update_wait : Duration :: from_secs ( 4 ) ,
846- propagation_wait : Duration :: from_secs ( 12 ) ,
840+ update_wait : Duration :: from_secs ( 6 ) ,
841+ propagation_wait : Duration :: from_secs ( 20 ) ,
847842 verbose_logging : false ,
848- check_interval : Some ( Duration :: from_secs ( 3 ) ) , // Regular check intervals
843+ check_interval : Some ( Duration :: from_secs ( 5 ) ) ,
849844 send_refresh_updates : true ,
850845 send_final_updates : true ,
851846 subscribe_immediately : true ,
0 commit comments