-
Notifications
You must be signed in to change notification settings - Fork 84
Add P2P Communication Validation Tests and Refactor addnode Tests #767
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
Add P2P Communication Validation Tests and Refactor addnode Tests #767
Conversation
|
|
This came up as a reference from this comment here #733 (comment). In this case I wanted to make a test to see if the handshake information when doing p2p communication between nodes is storing information correctly. So this |
|
Could you update after #777? There was a bug in the user agent that should be fixed now |
fdbe901 to
a3ebc99
Compare
315a1f1 to
1e0f45e
Compare
|
315a1f1 Fixed flaky test failures caused by nodes failing to start on the first attempt. Implemented retry logic (up to 3 attempts) when starting nodes, similar to what the Also added utility functions to check node connectivity that work across all variants, centralizing this logic so individual tests no longer need to implement it themselves. |
Implement a retry mechanism (max 3 attempts) for node startup. During integration tests, the first startup attempt often fails, but retrying typically resolves the issue.
Add a test to verify both the information Floresta sends to peers and the information it receives during P2P connections. The test checks: - Version string accuracy. - Advertised services and connection type. - Transport protocol and user agent.
Introduce universal helper functions for checking and waiting for peer connections. These functions work with all node variants (florestad, utreexod, and bitcoind). Node class additions: - `get_connection_info()`: Retrieves connection information for a node, including user_agent and p2p address, used to verify peer connectivity - `is_peer_connected()`: Checks whether a specific peer appears in the node's peer list FlorestaTestFramework class additions: - `check_connection()`: Verifies that two peers are connected or disconnected to each other (i.e., each appears in the other's peer list) - `wait_for_peers_connections()`: Waits up to 15 seconds for two peers to establish or drop a connection UtreexodRpc class addition: - `ping()`: I added the function so that all variants have this functionality.
Refactor the addnode-v1 and addnode-v2 tests to remove unnecessary sleep calls, improve readability, and eliminate redundant code.
1e0f45e to
06047cf
Compare
Davidson-Souza
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 06047cf
|
ACK 06047cf |
Description and Notes
A new integration test has been added to validate the correctness of information exchanged during P2P communication between Floresta and other nodes. The test verifies both the data Floresta sends to peers and the data it receives, ensuring compliance with expected P2P protocol behavior. Specifically, the test checks:
This test helps ensure that Floresta correctly identifies itself and interprets peer information during P2P handshakes and ongoing communication.
Additionally, the
addnode-v1andaddnode-v2tests have been refactored to remove unnecessary sleep calls and eliminate redundant code, improving readability and reducing test execution time without affecting correctness.How to verify the changes you have done?
addnode-v1andaddnode-v2tests to ensure unnecessary sleeps have been removed and duplicated code has been consolidated.