@@ -29,19 +29,18 @@ async fn test_basic_gateway(ctx: &mut TestContext) -> TestResult {
2929}
3030```
3131
32- ### Multi-Node Test with Auto-Connect
32+ ### Multi-Node Test
3333
3434``` rust
3535#[freenet_test(
3636 nodes = [" gateway" , " peer-1" , " peer-2" ],
37- auto_connect_peers = true ,
3837 aggregate_events = " on_failure"
3938)]
4039async fn test_network_operations (ctx : & mut TestContext ) -> TestResult {
4140 let gateway = ctx . gateway ()? ;
4241 let peers = ctx . peers ();
4342
44- // All peers are automatically configured to connect to the gateway
43+ // All peers automatically connect to the gateway (default behavior)
4544 assert_eq! (peers . len (), 2 );
4645
4746 // Your test logic here...
@@ -88,8 +87,7 @@ Set explicit ring locations for nodes (order must match the `nodes` list). This
8887``` rust
8988#[freenet_test(
9089 nodes = [" gateway" , " peer-a" , " peer-b" ],
91- node_locations = [0.2 , 0.6 , 0.85 ], // gateway, peer-a, peer-b
92- auto_connect_peers = true
90+ node_locations = [0.2 , 0.6 , 0.85 ] // gateway, peer-a, peer-b
9391)]
9492async fn test_with_locations (ctx : & mut TestContext ) -> TestResult {
9593 // Test logic here...
@@ -113,8 +111,7 @@ fn my_locations() -> Vec<f64> {
113111
114112#[freenet_test(
115113 nodes = [" gateway" , " peer-a" , " peer-b" ],
116- node_locations_fn = my_locations ,
117- auto_connect_peers = true
114+ node_locations_fn = my_locations
118115)]
119116```
120117
@@ -147,18 +144,22 @@ async fn test_with_node_configs(ctx: &mut TestContext) -> TestResult {
147144#### ` auto_connect_peers `
148145Automatically configure all peer nodes to connect to all gateway nodes.
149146
147+ ** Behavior:**
148+ - When ` true ` (default): Peers are pre-configured with gateway connection info
149+ - When ` false ` : You must manually configure peer connections
150+ - Works with multiple gateways (peers connect to all gateways)
151+
150152``` rust
153+ // Default behavior - peers auto-connect to gateways
154+ #[freenet_test(nodes = [" gateway" , " peer-1" , " peer-2" ])]
155+
156+ // Disable auto-connect for manual connection setup
151157#[freenet_test(
152158 nodes = [" gateway" , " peer-1" , " peer-2" ],
153- auto_connect_peers = true // Peers auto-connect to gateway
159+ auto_connect_peers = false
154160)]
155161```
156162
157- ** Behavior:**
158- - When ` true ` : Peers are pre-configured with gateway connection info
159- - When ` false ` (default): You must manually configure peer connections
160- - Works with multiple gateways (peers connect to all gateways)
161-
162163#### ` aggregate_events `
163164Control when event aggregation reports are generated.
164165
@@ -324,7 +325,6 @@ use freenet_stdlib::prelude::*;
324325
325326#[freenet_test(
326327 nodes = [" gateway" , " peer-1" , " peer-2" ],
327- auto_connect_peers = true ,
328328 timeout_secs = 180 ,
329329 startup_wait_secs = 15 ,
330330 aggregate_events = " on_failure" ,
@@ -474,7 +474,6 @@ EVENT LOG SUMMARY
474474#[freenet_test(
475475 nodes = [" gw-1" , " gw-2" , " peer-1" , " peer-2" , " peer-3" , " peer-4" ],
476476 gateways = [" gw-1" , " gw-2" ],
477- auto_connect_peers = true ,
478477 startup_wait_secs = 20 // More time for connections to establish
479478)]
480479```
@@ -561,9 +560,10 @@ Each approach has significant trade-offs. Using `Result`-based errors is the idi
561560** Problem:** Peers don't connect to gateway
562561
563562** Solutions:**
564- 1 . Use ` auto_connect_peers = true ` to handle connection setup automatically
565- 2 . Increase ` startup_wait_secs ` to allow more time for connections
566- 3 . Check gateway network port is set correctly
563+ 1 . ` auto_connect_peers ` is ` true ` by default, so connection setup is automatic
564+ 2 . If using ` auto_connect_peers = false ` , ensure manual connection setup is correct
565+ 3 . Increase ` startup_wait_secs ` to allow more time for connections
566+ 4 . Check gateway network port is set correctly
567567
568568### Multi-Gateway Tests Fail
569569
0 commit comments