@@ -16,12 +16,12 @@ use futures::{stream::FuturesUnordered, FutureExt, StreamExt};
1616use rand:: SeedableRng ;
1717use testresult:: TestResult ;
1818use tokio:: { select, time:: sleep, time:: timeout} ;
19- use tokio_tungstenite:: connect_async;
2019use tracing:: { span, Instrument , Level } ;
2120
2221use common:: {
23- base_node_test_config, base_node_test_config_with_rng, gw_config_from_path,
24- gw_config_from_path_with_rng, APP_TAG , PACKAGE_DIR , PATH_TO_CONTRACT ,
22+ base_node_test_config, base_node_test_config_with_rng, connect_async_with_config,
23+ gw_config_from_path, gw_config_from_path_with_rng, ws_config, APP_TAG , PACKAGE_DIR ,
24+ PATH_TO_CONTRACT ,
2525} ;
2626use freenet_ping_app:: ping_client:: {
2727 run_ping_client, wait_for_get_response, wait_for_put_response, wait_for_subscribe_response,
@@ -267,8 +267,9 @@ async fn test_node_diagnostics_query() -> TestResult {
267267 "ws://127.0.0.1:{ws_api_port_node}/v1/contract/command?encodingProtocol=native"
268268 ) ;
269269
270- let ( stream_gw, _) = connect_async ( & uri_gw) . await ?;
271- let ( stream_node, _) = connect_async ( & uri_node) . await ?;
270+ let ( stream_gw, _) = connect_async_with_config ( & uri_gw, Some ( ws_config ( ) ) , false ) . await ?;
271+ let ( stream_node, _) =
272+ connect_async_with_config ( & uri_node, Some ( ws_config ( ) ) , false ) . await ?;
272273
273274 let mut client_gw = WebApi :: start ( stream_gw) ;
274275 let mut client_node = WebApi :: start ( stream_node) ;
@@ -636,9 +637,11 @@ async fn test_ping_multi_node() -> TestResult {
636637 "ws://127.0.0.1:{ws_api_port_node2}/v1/contract/command?encodingProtocol=native"
637638 ) ;
638639
639- let ( stream_gw, _) = connect_async ( & uri_gw) . await ?;
640- let ( stream_node1, _) = connect_async ( & uri_node1) . await ?;
641- let ( stream_node2, _) = connect_async ( & uri_node2) . await ?;
640+ let ( stream_gw, _) = connect_async_with_config ( & uri_gw, Some ( ws_config ( ) ) , false ) . await ?;
641+ let ( stream_node1, _) =
642+ connect_async_with_config ( & uri_node1, Some ( ws_config ( ) ) , false ) . await ?;
643+ let ( stream_node2, _) =
644+ connect_async_with_config ( & uri_node2, Some ( ws_config ( ) ) , false ) . await ?;
642645
643646 let mut client_gw = WebApi :: start ( stream_gw) ;
644647 let mut client_node1 = WebApi :: start ( stream_node1) ;
@@ -1230,9 +1233,11 @@ async fn test_ping_application_loop() -> TestResult {
12301233 "ws://127.0.0.1:{ws_api_port_node2}/v1/contract/command?encodingProtocol=native"
12311234 ) ;
12321235
1233- let ( stream_gw, _) = connect_async ( & uri_gw) . await ?;
1234- let ( stream_node1, _) = connect_async ( & uri_node1) . await ?;
1235- let ( stream_node2, _) = connect_async ( & uri_node2) . await ?;
1236+ let ( stream_gw, _) = connect_async_with_config ( & uri_gw, Some ( ws_config ( ) ) , false ) . await ?;
1237+ let ( stream_node1, _) =
1238+ connect_async_with_config ( & uri_node1, Some ( ws_config ( ) ) , false ) . await ?;
1239+ let ( stream_node2, _) =
1240+ connect_async_with_config ( & uri_node2, Some ( ws_config ( ) ) , false ) . await ?;
12361241
12371242 let mut client_gw = WebApi :: start ( stream_gw) ;
12381243 let mut client_node1 = WebApi :: start ( stream_node1) ;
@@ -1718,7 +1723,8 @@ async fn test_ping_partially_connected_network() -> TestResult {
17181723 let uri = format ! (
17191724 "ws://127.0.0.1:{port}/v1/contract/command?encodingProtocol=native"
17201725 ) ;
1721- let ( stream, _) = connect_async ( & uri) . await ?;
1726+ let ( stream, _) =
1727+ connect_async_with_config ( & uri, Some ( ws_config ( ) ) , false ) . await ?;
17221728 let client = WebApi :: start ( stream) ;
17231729 gateway_clients. push ( client) ;
17241730 tracing:: info!( "Connected to gateway {}" , i) ;
@@ -1729,7 +1735,8 @@ async fn test_ping_partially_connected_network() -> TestResult {
17291735 let uri = format ! (
17301736 "ws://127.0.0.1:{port}/v1/contract/command?encodingProtocol=native"
17311737 ) ;
1732- let ( stream, _) = connect_async ( & uri) . await ?;
1738+ let ( stream, _) =
1739+ connect_async_with_config ( & uri, Some ( ws_config ( ) ) , false ) . await ?;
17331740 let client = WebApi :: start ( stream) ;
17341741 node_clients. push ( client) ;
17351742 tracing:: info!( "Connected to regular node {}" , i) ;
0 commit comments