Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: fix a race in TestP2PwsStreamHandlerDedup #6116

Merged

Conversation

algorandskiy
Copy link
Contributor

@algorandskiy algorandskiy commented Aug 28, 2024

Summary

There were couple failures in TestP2PwsStreamHandlerDedup caused by too early check on the second node - before it had a chance to handle connection closure and remove unsuccessful peer.

Additionally, there is also an attempt to fix TestCapabilities_Discovery that works on non-connected p2p hosts, manually adds peers to DHT routing table and then compares the table expected size.
Not sure what exactly it was testing (adding to routing table and checking its size looks unusual) but there is a race between capD.dht.ForceRefresh() and capD.dht.RoutingTable().Size() since as soon as it completes it prunes all non-reachable peers (and they all unreachable).
Having said that the test looks quite useless so I removed it.

Test Plan

This is a test fix.

@algorandskiy algorandskiy added Bug-Fix p2p Work related to the p2p project labels Aug 28, 2024
@algorandskiy algorandskiy requested review from cce and gmalouf August 28, 2024 21:52
@algorandskiy algorandskiy self-assigned this Aug 28, 2024
Copy link

codecov bot commented Aug 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.19%. Comparing base (e14fea6) to head (3395b0c).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6116   +/-   ##
=======================================
  Coverage   56.19%   56.19%           
=======================================
  Files         492      492           
  Lines       69783    69783           
=======================================
  Hits        39212    39212           
- Misses      27902    27904    +2     
+ Partials     2669     2667    -2     

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

gmalouf
gmalouf previously approved these changes Aug 29, 2024
@algorandskiy algorandskiy merged commit 10e8b39 into algorand:master Aug 29, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug-Fix p2p Work related to the p2p project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants