-
Notifications
You must be signed in to change notification settings - Fork 38.7k
[tests] various improvements to zmq_test.py #10555
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
a4ad588 to
a0af693
Compare
|
|
a0af693 to
c4f6b7f
Compare
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.
tested ACK c4f6b7f
|
Oops. Accidentally squashed two commits together in my last fixup. I've divided this PR back into the correct number of commits. https://github.com/jnewbery/bitcoin/tree/pr10555.1 == https://github.com/jnewbery/bitcoin/tree/pr10555.2 |
test/functional/zmq_test.py
Outdated
| assert_equal(hashRPC, hashZMQ) # txid from sendtoaddress must be equal to the hash received over zmq | ||
|
|
||
| # Destroy the zmq context | ||
| self.zmqContext.destroy(linger=None) |
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.
when test failed this won't be called and the process will hang, might be good to call this in finally block
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.
Good point @somdoron. Added a fixup commit 72a54cce9ebc3ee1efd69c5d16b11ca54c25783a. Can you take a look and let me know what you think. If you're happy I'll squash with the previous commit.
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.
looks good
c4f6b7f to
a2106d8
Compare
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.
You can also call socket.SET(zmq.RCVTIMEO, 60000) when creating the socket instead of the NOBLOCK and the loop. It will raise zmq.error.Again when time is over
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.
Thanks! I didn't know about zmq.RCVTIMEO. Updated to use that instead of the timeout loop in b1bac1c
a2106d8 to
d8a3616
Compare
d8a3616 to
0a4912e
Compare
|
Concept ACK 0a4912e |
0a4912e [tests] timeout integration tests on travis after 20 minutes (John Newbery) 7c51e9f [tests] destroy zmq context in zmq_tests.py (John Newbery) b1bac1c [tests] in zmq test, timeout if message not received (John Newbery) 5ebd5f9 [tests] tidy up zmq_test.py (John Newbery) 4a0c08f [tests] update zmq test to use correct config.ini file (John Newbery) Tree-SHA512: 5e607af2f2dc5c73fba4b2d3890097580a7525f6a4996c7c78f01822e45e0054fd0a225ea53fce6308804e560cced6de6cf5d16137469dcf100b2e9643e08d03
0a4912e [tests] timeout integration tests on travis after 20 minutes (John Newbery) 7c51e9f [tests] destroy zmq context in zmq_tests.py (John Newbery) b1bac1c [tests] in zmq test, timeout if message not received (John Newbery) 5ebd5f9 [tests] tidy up zmq_test.py (John Newbery) 4a0c08f [tests] update zmq test to use correct config.ini file (John Newbery) Tree-SHA512: 5e607af2f2dc5c73fba4b2d3890097580a7525f6a4996c7c78f01822e45e0054fd0a225ea53fce6308804e560cced6de6cf5d16137469dcf100b2e9643e08d03
This PR contains various improvements to zmq_test.py, including stopping it from hanging and causing travis builds to time out. Individual commits are:
sys.exit()to fail. This would cause travis builds to hang. See https://stackoverflow.com/questions/17140417/termination-of-python-script-while-using-zeromq-with-dead-server for more details.I need this for the next step of #10082, since this test was causing the next PR to hang in travis.
I believe this will also fix #10552 once that is rebased on top of this.