[Test] Tests for zmqpubrawtx and zmqpubrawblock#10552
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.
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.
nit: why not placed alphabetically like the other imports?
There was a problem hiding this comment.
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.
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.
No need for the duplicated comment
test/functional/zmq_test.py
Outdated
test/functional/zmq_test.py
Outdated
There was a problem hiding this comment.
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.
Nit, rename to hash256 to resemble CHash256?
test/functional/zmq_test.py
Outdated
|
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 |
There was a problem hiding this comment.
Move before hex_str_to_bytes.
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.