-
Notifications
You must be signed in to change notification settings - Fork 38.7k
test: remove race in the user-agent reception check #27986
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
test: remove race in the user-agent reception check #27986
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
|
I stumbled on this playing with #27509: CI logThe test calls |
44d71cf to
9c46f3b
Compare
|
|
9c46f3b to
c1a1690
Compare
|
|
jonatack
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.
Light tested ACK c1a169082ac1147ec2f3cc329f23bc0bfc28cd6b
c1a1690 to
28d26c4
Compare
|
Invalidates ACK from @jonatack |
|
ACK 28d26c4f37c433e35a4a05e144d05f0e464f8452 |
In `add_p2p_connection()` we connect to `bitcoind` from the Python
client and check that it has received our version string.
This check looked up the last/newest entry from `getpeerinfo` RPC,
assuming that it must be the connection we have just opened. But this
will not be the case if a new inbound or outbound connection is made
to/from `bitcoind` in the meantime.
Instead of the last entry in `getpeerinfo`, check all and find the one
which corresponds to our connection using our outgoing address:port
tuple which is unique.
Co-authored-by: MarcoFalke <*~=`'#}+{/-|&$^[email protected]>
Co-authored-by: Jon Atack <[email protected]>
28d26c4 to
20b4946
Compare
|
Invalidates ACK from @jonatack |
|
Concept ACK |
|
re-ACK 20b4946 |
|
Anything further needed here? |
|
Concept ACK 20b4946 Probably an edge case, but it seems useful to have this in case connections are opened at the same time for some reason. |
|
The tests from #27509 failed because of this which prompted me to open this PR. |
In
add_p2p_connection()we connect tobitcoindfrom the Python client and check that it has received our version string.This check looked up the last/newest entry from
getpeerinfoRPC, assuming that it must be the connection we have just opened. But this will not be the case if a new inbound or outbound connection is made to/frombitcoindin the meantime.Instead of the last entry in
getpeerinfo, check all and find the one which corresponds to our connection using our outgoing address:port tuple which is unique.