-
Notifications
You must be signed in to change notification settings - Fork 38.7k
[Test] Tests for zmqpubrawtx and zmqpubrawblock #10552
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
|
Both linux builds timed out after ~48 minutes. |
|
I suspect that this timeout is due to the python3-zmq Context not closing cleanly at the end of the zmq_test.py test. See https://stackoverflow.com/questions/17140417/termination-of-python-script-while-using-zeromq-with-dead-server for example. I'm working on a branch that fixes that behaviour here: https://github.com/jnewbery/bitcoin/tree/zmqtestimprovements . It's currently building in Travis. If that works, you might want to try rebasing this PR on top of that branch to see if it resolves this for you. |
|
Rebased on top of #10555 |
|
Reopen. Was closed due to false positive regex match by GitHub. |
87f833e to
b734d91
Compare
|
Rebased after #10555 merge. |
|
rebased |
5184e47 to
eeac6e6
Compare
jnewbery
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.
An unfortunate aspect of this test is that it assumes an order for ZMQ notifications (tx > rawtx > hashblock > rawblock). I don't think that's necessary or should be asserted in the test. However, you've just extended what's already here, so concept ACK.
Please run a linter over this and fix up the warnings. There are a bunch of nits (unused imports, trailing whitespace, etc).
A few more nits inline.
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.
nit: why not placed alphabetically like the other imports?
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.
Please place this in the 'Utility Functions' section, rather than 'Node Functions'
test/functional/zmq_test.py
Outdated
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.
why not just assign txhash on line 69. There's no reason to have body in this section.
test/functional/zmq_test.py
Outdated
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.
No need for the duplicated comment
test/functional/zmq_test.py
Outdated
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.
No need for this line
test/functional/zmq_test.py
Outdated
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.
I'd move this assert to immediately after the topic = ... line (like in the previous tests in this script).
865e07d to
ba0b4f1
Compare
|
Nits addresses (I think) and rebased (there were merge conflicts). |
|
Tested ACK ba0b4f1c0a2c47f2f8c342686c94c6e358ea4efe, but needs rebase. |
|
Rebased |
ba0b4f1 to
a3696dc
Compare
|
Tested ACK a3696dcec45f11f202c1666084c4aa1f8fabd37f |
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.
In the future we could (partially) change to one socket per notification. As it is, the order matters and requires checking for topic when iterating.
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.
Nit, rename to hash256 to resemble CHash256?
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.
Done
test/functional/zmq_test.py
Outdated
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.
Ultra nit, sort arguments.
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.
Done
|
Just saw @jnewbery comment above:
Can be fixed with one socket per notification. |
a3696dc to
d30a9ab
Compare
@promag - sounds like a very sensible change. This PR simply extends what's already there so I think we should merge this as is. I'd be happy to review a follow-up PR if you want to implement that. |
|
@jnewbery agree. As for the follow up, I think it could be added somewhere in |
promag
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.
utACK.
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.
Move before hex_str_to_bytes.
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.
Done
d30a9ab to
d3677ab
Compare
If you're thinking of abstracting away the ZMQ interface, I think it would be better to add a new class in test_node.py to be owned by the However, the ZMQ interface is only used in this one test script, and I think it's best to keep it that way, so I think it's best to leave the implementation in the We've wondered off-topic a bit for this PR. If you're interested in pursuing this further, feel free to ping me on IRC or open a separate issue. |
|
Can this be merged? |
d3677ab Tests for zmqpubrawtx and zmqpubrawblock (Andrew Chow) Pull request description: Tree-SHA512: 9e367fd8936514bfb567ef3f3d83770d374287354b59c9187e844056dd086e8aa2de32ce55d35486cecd706e7c93cd1c1e2709ee82d3dddb805827be8d2bcb14
Github-Pull: bitcoin#10552 Rebased-From: d3677ab
d3677ab Tests for zmqpubrawtx and zmqpubrawblock (Andrew Chow) Pull request description: Tree-SHA512: 9e367fd8936514bfb567ef3f3d83770d374287354b59c9187e844056dd086e8aa2de32ce55d35486cecd706e7c93cd1c1e2709ee82d3dddb805827be8d2bcb14
No description provided.