-
Notifications
You must be signed in to change notification settings - Fork 37.7k
[test] clarify rpc_net & p2p_disconnect_ban functional tests #19877
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
Conversation
Concept ACK, thanks for clarifying! After trying to trace the code, I agree with you that
|
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.
Concept ACK
As @robot-dreams mentioned, these changes could be applied in L147.
Also, similar behaviour can be seen in tests\functional\p2p_disconnect_ban.py
L21 and L80, e.g.
def run_test(self):
self.log.info("Connect nodes both way")
connect_nodes(self.nodes[0], 1)
connect_nodes(self.nodes[1], 0)
...
so updating code there as well could be an option.
As a reference, original change was introduced in this PR: https://github.com/bitcoin/bitcoin/pull/16898/files
9bd90db
to
00ea3fc
Compare
thanks for the reviews @ipriver, @robot-dreams & @epson121 ! thoughts around review suggestions / questions :
good suggestion but I've looked into it & have found that those connections are important to leave in. Here is why: at the start of the test, the test framework creates the initial node connection behind the scenes, so we only need one additional Let me know if this doesn't make sense / if there are further questions. You can test it out by commenting out either/both of the lines & seeing the following assertions fail.
hm, good observation. let's think this through...
I think overall, if a test wanted to do something like "send another message, check that message was received", it would want to use a
nice catch! I've updated the setup on L21. but with L80, we need to leave it in for a similar reason to what I explained earlier for the |
Concept ACK. Are there any edge cases where the P2P behavior of a one-sided connection is different to a two-sided connection? Do we want to test both or is a two-sided connection sufficient? |
@michaelfolkson not sure what you mean... I think you're asking about a subset of the tests? |
ACK 00ea3fc Thanks for clarifying! I previously had a brain error—for some reason I thought a single I tested locally to make sure that the In addition, the As for my |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
00ea3fc
to
c069690
Compare
rebased |
c069690
to
686283d
Compare
Since the test framework automatically sets up a connection between the nodes, the second connect_nodes call was a no-op. Remove the redundant call & add comments to explain the expected topology.
686283d
to
47ff509
Compare
rebased |
ACK 47ff509 |
…tional tests 47ff509 [test] Clarify setup of node topology. (Amiti Uttarwar) 0672522 [move-only, test]: Match test order with run order (Amiti Uttarwar) Pull request description: small improvements to clarify logic in the functional tests 1. have test logic in `rpc_net.py` match run order of the test 2. remove `connect_nodes` calls that are redundant with the automatic test setup executed by the test framework Noticed when I was trying to debug a test for bitcoin#19725. Small changes but imo very helpful, because they initially confused me. ACKs for top commit: laanwj: ACK 47ff509 Tree-SHA512: 2843da2c0b4f06b2600b3adb97900a62be7bb2228770abd67d86f2a65c58079af22c7c20957474a98c17da85f40a958a6f05cb8198aa0c56a58adc1c31100492
small improvements to clarify logic in the functional tests
rpc_net.py
match run order of the testconnect_nodes
calls that are redundant with the automatic test setup executed by the test frameworkNoticed when I was trying to debug a test for #19725. Small changes but imo very helpful, because they initially confused me.