Restore test_three_node_network_connectivity as minimal failing test for peer connectivity bug #1905
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR restores
test_three_node_network_connectivityand fixes a critical bug in peer recommendation that was preventing peer-to-peer mesh formation.Changes
1. Restored Test (commit ba64098)
Restored
test_three_node_network_connectivityfrom commit 24a6b7c. This test verifies full mesh connectivity in a 3-node network (1 gateway + 2 peers).2. Critical Bug Fix: Peer Recommendation Skip-List (commit 18a750e)
Problem: In
connect.rs:197, when handlingFindOptimalPeerrequests, the gateway was only skipping the joiner peer:This caused the gateway to repeatedly recommend itself or already-connected peers, preventing mesh formation.
Fix: Use the full skip_connections set:
History: This fix was originally in commit 24a6b7c (branch
fix/connection-maintenance-skip-list) but was never merged to main. This PR reapplies that critical fix.3. Test Configuration Improvements (commit 18a750e)
min_connections=2andmax_connections=2(realistic for 3-node network, default is 25)aggressive_initial_connections()(10s) to completeCurrent Status
Test Status: ❌ Still failing
The skip-list fix was necessary but not sufficient. After applying it:
Peers successfully connect to the gateway but don't discover each other.
Investigation Summary
Systematic debugging revealed:
aggressive_initial_connections()blocking for 10s - addressed with delaysNext Steps
Further investigation needed to understand why:
The test provides a minimal reproducer for the peer connectivity bug and the skip-list fix addresses one known issue, but more work is needed.
Related Issues
🤖 Generated with Claude Code
[AI-assisted debugging and comment]