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

[WIP] Integration Test for disconnecting downstream connections on all roles #1434

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

plebhash
Copy link
Collaborator

@plebhash plebhash commented Feb 1, 2025

close #1432

WIP, blocked by #1420 and #1418

note: mining_proxy_sv2crate does not follow the same pattern of providing a struct representing the role (where is_listening API was added)... as a consequence, its listening port is not accessible in the test environment and therefore this role is not being covered on this PR

Copy link

codecov bot commented Feb 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 20.29%. Comparing base (1a5d9c8) to head (7bd9bdf).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1434      +/-   ##
==========================================
- Coverage   24.04%   20.29%   -3.76%     
==========================================
  Files         112      146      +34     
  Lines        7942     9893    +1951     
==========================================
+ Hits         1910     2008      +98     
- Misses       6032     7885    +1853     
Flag Coverage Δ
binary_codec_sv2-coverage 0.00% <ø> (ø)
binary_serde_sv2-coverage 3.40% <ø> (ø)
binary_sv2-coverage 5.11% <ø> (ø)
bip32_derivation-coverage 0.00% <ø> (ø)
buffer_sv2-coverage 25.02% <ø> (ø)
codec_sv2-coverage 0.01% <ø> (ø)
common_messages_sv2-coverage 0.12% <ø> (ø)
const_sv2-coverage 0.00% <ø> (ø)
error_handling-coverage 0.00% <ø> (ø)
framing_sv2-coverage 0.27% <ø> (ø)
jd_server-coverage 7.79% <ø> (?)
job_declaration_sv2-coverage 0.00% <ø> (ø)
key-utils-coverage 2.39% <ø> (ø)
mining-coverage 2.34% <ø> (ø)
mining_device-coverage 0.00% <ø> (?)
mining_proxy_sv2-coverage 0.70% <ø> (?)
noise_sv2-coverage 4.25% <ø> (ø)
pool_sv2-coverage 2.04% <ø> (?)
protocols 23.86% <ø> (ø)
roles 5.02% <ø> (?)
roles_logic_sv2-coverage 8.70% <ø> (ø)
sv2_ffi-coverage 0.00% <ø> (ø)
template_distribution_sv2-coverage 0.00% <ø> (ø)
utils 25.13% <ø> (ø)
v1-coverage 2.31% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@plebhash plebhash force-pushed the downstream_disconnect_integration_tests branch from ac0c979 to 318fd1d Compare February 1, 2025 14:45
@plebhash plebhash force-pushed the downstream_disconnect_integration_tests branch from 318fd1d to 7bd9bdf Compare February 1, 2025 14:50
Copy link
Contributor

@jbesraa jbesraa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm.. this "is_listening" is nice to use in testing env from the outside but I dont see how this is related to any of the roles. All of the is_listening functions can be "is_port_open" in test env and give it the role port(thats why the roles in test env return their SocketAddr).
If is_listening had access to the actual socket and checked if it can receive messages, that would be great - but checking with TcpStream::connect and calling the function "is_listening" gives the wrong impression

@plebhash
Copy link
Collaborator Author

plebhash commented Feb 3, 2025

hmm.. this "is_listening" is nice to use in testing env from the outside but I dont see how this is related to any of the roles. All of the is_listening functions can be "is_port_open" in test env and give it the role port(thats why the roles in test env return their SocketAddr). If is_listening had access to the actual socket and checked if it can receive messages, that would be great - but checking with TcpStream::connect and calling the function "is_listening" gives the wrong impression

so are you suggesting that:

  • this API should be renamed to more accurately reflect its functionality
    OR
  • this API is not a sufficient criteria for what we're aiming to test

?

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.

need Integration Test for disconnecting downstream connections on all roles
2 participants