Skip to content

Add tests for discovery methods in circuit_relay_v2 #750

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

Merged
merged 3 commits into from
Jul 11, 2025

Conversation

sukhman-sukh
Copy link
Contributor

@sukhman-sukh sukhman-sukh commented Jul 7, 2025

What was wrong?

Added complete set of tests for all the 3 methods provided for relay discovery
Also, the clear_peerdata function was not implemented.
Issue # #749
Closes #749

How was it fixed?

  • _check_via_peerstore method is tested as default
  • _check_via_direct_connection method is tested by manually removing the peer from peerstore after connection to fail peerstore check.
  • _check_via_mux method is tested by manually removing the peer from peerstore and then mimicing _check_via_direct_connection to return None always as POC.
  • Added logic for clear_peerdata in the peerstore

Cute Animal Picture

put a cute animal picture link inside the parentheses

@pacrob
Copy link
Member

pacrob commented Jul 10, 2025

Thanks @sukhman-sukh! It looks like you also implemented the clear_peerdata method, so please add a note about that to the PR. For newsfragments, please rename the current one (regarding adding tests) to 749.internal.rst, and make another 750.feature.rst for the clear_peerdata method.

Once that's done, good to merge! Awesome!

@pacrob pacrob merged commit dd14aad into libp2p:main Jul 11, 2025
28 checks passed
Jineshbansal pushed a commit to Jineshbansal/py-libp2p that referenced this pull request Jul 13, 2025
* Add test for direct_connection_relay_discovery

* Add test for mux_method_relay_discovery

* Fix newsfragments
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.

RelayDiscovery methods not covered in test
2 participants