Skip to content

Commit dd942bb

Browse files
claudeiduartgomez
authored andcommitted
refactor: remove redundant comments from test_small_network_get_issue
Removes unnecessary implementation notes that were no longer relevant after previous fixes to connection management and timeout handling. Related to issue #2023 investigation.
1 parent 31f2321 commit dd942bb

File tree

5 files changed

+15
-36
lines changed

5 files changed

+15
-36
lines changed

apps/freenet-ping/app/tests/run_app.rs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use rand::SeedableRng;
1717
use testresult::TestResult;
1818
use tokio::{select, time::sleep, time::timeout};
1919
use tokio_tungstenite::connect_async;
20-
use tracing::{level_filters::LevelFilter, span, Instrument, Level};
20+
use tracing::{span, Instrument, Level};
2121

2222
use common::{
2323
base_node_test_config, base_node_test_config_with_rng, gw_config_from_path,
@@ -171,10 +171,8 @@ async fn collect_node_diagnostics(
171171
Ok(())
172172
}
173173

174-
#[tokio::test(flavor = "multi_thread")]
174+
#[test_log::test(tokio::test(flavor = "multi_thread"))]
175175
async fn test_node_diagnostics_query() -> TestResult {
176-
freenet::config::set_logger(Some(LevelFilter::DEBUG), None);
177-
178176
// Setup network sockets for the gateway and client node
179177
let network_socket_gw = TcpListener::bind("127.0.0.1:0")?;
180178
let ws_api_port_socket_gw = TcpListener::bind("127.0.0.1:0")?;
@@ -463,10 +461,8 @@ async fn test_node_diagnostics_query() -> TestResult {
463461
}
464462

465463
#[ignore = "this test currently fails and we are workign on fixing it"]
466-
#[tokio::test(flavor = "multi_thread")]
464+
#[test_log::test(tokio::test(flavor = "multi_thread"))]
467465
async fn test_ping_multi_node() -> TestResult {
468-
freenet::config::set_logger(Some(LevelFilter::DEBUG), None);
469-
470466
// Setup network sockets for the gateway
471467
let network_socket_gw = TcpListener::bind("127.0.0.1:0")?;
472468

@@ -1092,10 +1088,8 @@ async fn test_ping_multi_node() -> TestResult {
10921088
}
10931089

10941090
#[ignore = "this test currently fails and we are workign on fixing it"]
1095-
#[tokio::test(flavor = "multi_thread")]
1091+
#[test_log::test(tokio::test(flavor = "multi_thread"))]
10961092
async fn test_ping_application_loop() -> TestResult {
1097-
freenet::config::set_logger(Some(LevelFilter::DEBUG), None);
1098-
10991093
// Setup network sockets for the gateway
11001094
let network_socket_gw = TcpListener::bind("127.0.0.1:0")?;
11011095

@@ -1519,7 +1513,7 @@ async fn test_ping_application_loop() -> TestResult {
15191513
Ok(())
15201514
}
15211515

1522-
#[tokio::test(flavor = "multi_thread")]
1516+
#[test_log::test(tokio::test(flavor = "multi_thread"))]
15231517
#[ignore = "Test has never worked - gateway nodes fail on startup with channel closed errors"]
15241518
async fn test_ping_partially_connected_network() -> TestResult {
15251519
/*
@@ -1551,8 +1545,6 @@ async fn test_ping_partially_connected_network() -> TestResult {
15511545
const NUM_REGULAR_NODES: usize = 7;
15521546
const CONNECTIVITY_RATIO: f64 = 0.5; // Controls connectivity between regular nodes
15531547

1554-
// Configure logging
1555-
freenet::config::set_logger(Some(LevelFilter::DEBUG), None);
15561548
tracing::info!(
15571549
"Starting test with {} gateways and {} regular nodes (connectivity ratio: {})",
15581550
NUM_GATEWAYS,

apps/freenet-ping/app/tests/run_app_blocked_peers.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ use common::{
4848
base_node_test_config, get_all_ping_states, gw_config_from_path, ping_states_equal, APP_TAG,
4949
PACKAGE_DIR, PATH_TO_CONTRACT,
5050
};
51-
use freenet::{config::set_logger, local_node::NodeConfig, server::serve_gateway};
51+
use freenet::{local_node::NodeConfig, server::serve_gateway};
5252
use freenet_ping_app::ping_client::{
5353
wait_for_get_response, wait_for_put_response, wait_for_subscribe_response,
5454
};
@@ -61,7 +61,7 @@ use futures::FutureExt;
6161
use testresult::TestResult;
6262
use tokio::{select, time::sleep};
6363
use tokio_tungstenite::connect_async;
64-
use tracing::{level_filters::LevelFilter, span, Instrument, Level};
64+
use tracing::{span, Instrument, Level};
6565

6666
/// Configuration for blocked peers test variants
6767
#[derive(Debug, Clone)]
@@ -98,7 +98,6 @@ async fn run_blocked_peers_test(config: BlockedPeersConfig) -> TestResult {
9898
"debug,freenet::operations::subscribe=trace,freenet::contract=trace",
9999
);
100100
}
101-
set_logger(Some(LevelFilter::DEBUG), None);
102101

103102
tracing::info!("Starting {} blocked peers test...", config.test_name);
104103

@@ -782,7 +781,7 @@ async fn run_blocked_peers_test(config: BlockedPeersConfig) -> TestResult {
782781
}
783782

784783
/// Standard blocked peers test (baseline)
785-
#[tokio::test(flavor = "multi_thread")]
784+
#[test_log::test(tokio::test(flavor = "multi_thread"))]
786785
#[ignore]
787786
async fn test_ping_blocked_peers() -> TestResult {
788787
run_blocked_peers_test(BlockedPeersConfig {
@@ -802,7 +801,7 @@ async fn test_ping_blocked_peers() -> TestResult {
802801
}
803802

804803
/// Simple blocked peers test
805-
#[tokio::test(flavor = "multi_thread")]
804+
#[test_log::test(tokio::test(flavor = "multi_thread"))]
806805
#[ignore]
807806
async fn test_ping_blocked_peers_simple() -> TestResult {
808807
run_blocked_peers_test(BlockedPeersConfig {
@@ -825,7 +824,7 @@ async fn test_ping_blocked_peers_simple() -> TestResult {
825824
// as they only varied in non-functional aspects like timeouts and logging
826825

827826
/// Solution/reference implementation for blocked peers
828-
#[tokio::test(flavor = "multi_thread")]
827+
#[test_log::test(tokio::test(flavor = "multi_thread"))]
829828
#[ignore = "fix me"]
830829
async fn test_ping_blocked_peers_solution() -> TestResult {
831830
run_blocked_peers_test(BlockedPeersConfig {

apps/freenet-ping/app/tests/run_app_partially_connected_network.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,13 @@ use futures::FutureExt;
2828
use testresult::TestResult;
2929
use tokio::{select, time::timeout};
3030
use tokio_tungstenite::connect_async;
31-
use tracing::{level_filters::LevelFilter, span, Instrument, Level};
31+
use tracing::{span, Instrument, Level};
3232

3333
use common::{base_node_test_config, gw_config_from_path, APP_TAG, PACKAGE_DIR, PATH_TO_CONTRACT};
3434

35-
#[tokio::test(flavor = "multi_thread")]
35+
#[test_log::test(tokio::test(flavor = "multi_thread"))]
3636
#[ignore = "Test has never worked - nodes fail on startup with channel closed errors"]
3737
async fn test_ping_partially_connected_network() -> TestResult {
38-
freenet::config::set_logger(Some(LevelFilter::DEBUG), None);
3938
/*
4039
* This test verifies how subscription propagation works in a partially connected network.
4140
*
@@ -68,8 +67,6 @@ async fn test_ping_partially_connected_network() -> TestResult {
6867
const NUM_REGULAR_NODES: usize = 7;
6968
const CONNECTIVITY_RATIO: f64 = 0.3; // Controls connectivity between regular nodes
7069

71-
// Configure logging
72-
freenet::config::set_logger(Some(LevelFilter::DEBUG), None);
7370
println!(
7471
"Starting test with {NUM_GATEWAYS} gateways and {NUM_REGULAR_NODES} regular nodes (connectivity ratio: {CONNECTIVITY_RATIO})"
7572
);

apps/freenet-ping/app/tests/test_50_node_operations.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,16 @@ use std::{net::TcpListener, path::PathBuf, time::Duration};
2020
use testresult::TestResult;
2121
use tokio::{select, time::timeout};
2222
use tokio_tungstenite::connect_async;
23-
use tracing::level_filters::LevelFilter;
2423

2524
use common::{base_node_test_config, gw_config_from_path, APP_TAG, PACKAGE_DIR, PATH_TO_CONTRACT};
2625

2726
const NUM_GATEWAYS: usize = 3; // Multiple gateways to distribute load
2827
const NUM_REGULAR_NODES: usize = 47; // 3 + 47 = 50 total
2928
const CONNECTIVITY_RATIO: f64 = 0.1; // 10% connectivity to reduce network load
3029

31-
#[tokio::test(flavor = "multi_thread")]
30+
#[test_log::test(tokio::test(flavor = "multi_thread"))]
3231
#[ignore = "large scale test - run manually"]
3332
async fn test_50_node_operations() -> TestResult {
34-
freenet::config::set_logger(Some(LevelFilter::INFO), None);
35-
3633
println!("🚀 Starting 50-node operations test");
3734
println!(" Gateway nodes: {NUM_GATEWAYS}");
3835
println!(" Regular nodes: {NUM_REGULAR_NODES}");

apps/freenet-ping/app/tests/test_connection_timing.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,12 @@ use futures::FutureExt;
1212
use testresult::TestResult;
1313
use tokio::{select, time::timeout};
1414
use tokio_tungstenite::connect_async;
15-
use tracing::{level_filters::LevelFilter, span, Instrument, Level};
15+
use tracing::{span, Instrument, Level};
1616

1717
use common::{base_node_test_config, gw_config_from_path};
1818

19-
#[tokio::test(flavor = "multi_thread")]
19+
#[test_log::test(tokio::test(flavor = "multi_thread"))]
2020
async fn test_connection_timing() -> TestResult {
21-
// Minimal logging to reduce noise
22-
freenet::config::set_logger(
23-
Some(LevelFilter::WARN),
24-
Some("freenet::transport=info,freenet_core::transport=info".to_string()),
25-
);
26-
2721
println!("🔧 Testing connection timing with 2 nodes");
2822

2923
// Setup only 2 nodes to minimize complexity

0 commit comments

Comments
 (0)