Skip to content

Conversation

@pinebit
Copy link
Collaborator

@pinebit pinebit commented Dec 11, 2025

Fix flaky TestSyncFlow test, specifically the three_connect_one_disconnect case.

Problem

The test was probably flaky because it relied on passive TCP timeouts to detect peer disconnections. When a peer was "stopped" (via context cancellation), other peers wouldn't detect the disconnection quickly, causing the test to hang or timeout intermittently in CI.

Solution

Added explicit libp2p connection closure when simulating peer disconnection in the test. When the test stops a peer, it now iterates through all other running peers and forcibly closes the libp2p connection to the stopped peer using host.Network().ClosePeer(). This ensures immediate failure detection without relying on timeouts.

category: refactor
ticket: none

@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.34%. Comparing base (1c29397) to head (54558c4).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4167      +/-   ##
==========================================
+ Coverage   56.29%   56.34%   +0.04%     
==========================================
  Files         245      245              
  Lines       31246    31246              
==========================================
+ Hits        17591    17606      +15     
+ Misses      11337    11328       -9     
+ Partials     2318     2312       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pinebit pinebit added the merge when ready Indicates bulldozer bot may merge when all checks pass label Dec 16, 2025
@obol-bulldozer obol-bulldozer bot merged commit 50f20a8 into main Dec 16, 2025
13 of 14 checks passed
@obol-bulldozer obol-bulldozer bot deleted the pinebit/testsyncflow-another-fix branch December 16, 2025 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge when ready Indicates bulldozer bot may merge when all checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants