Skip to content

fix: improve mesh topology assertion to wait for connection formation#103

Merged
sanity merged 2 commits intomainfrom
fix/six-peer-connection-limits
Feb 16, 2026
Merged

fix: improve mesh topology assertion to wait for connection formation#103
sanity merged 2 commits intomainfrom
fix/six-peer-connection-limits

Conversation

@sanity
Copy link
Contributor

@sanity sanity commented Feb 16, 2026

Problem

The six-peer regression test consistently fails because the mesh topology assertion
is too weak — it only checks that peers have at least 1 P2P connection, then
proceeds with the test. Most peers end up with only 2-3 connections (below
min_connections=4), causing subscription updates to not propagate.

Approach

Replace the one-shot assertion with a polling loop that waits up to 90 seconds
for all peers to reach at least 2 P2P connections. This gives the topology manager
time to establish connections through Docker NAT.

Testing

This addresses the consistent six-peer-regression failures seen on freenet-core
PRs #3023 and #3031. The connections are stable (no drops after the keepalive fix
in freenet-core) but insufficient due to slow formation through Docker NAT.

[AI-assisted - Claude]

sanity and others added 2 commits February 15, 2026 18:14
The test creates a 7-node network (6 peers + 1 gateway) but peers
default to min_connections=25, which is unachievable. This causes
perpetual topology churn as peers endlessly try to reach the minimum,
destabilizing existing connections and breaking UPDATE propagation.

Setting min=4, max=5 gives peers achievable targets, eliminating
the connection churn that was causing flaky test failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The mesh assertion previously checked once and only required that
peers have at least 1 P2P connection. This was too weak — peers
with only 1-2 connections can't reliably propagate subscription
updates, causing the six-peer test to fail.

Now the assertion polls every 10 seconds for up to 90 seconds,
waiting until ALL peers have at least 2 P2P connections. This
gives the topology manager time to establish connections through
Docker NAT, which can be slow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sanity sanity merged commit 9c91ad5 into main Feb 16, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant