-
Notifications
You must be signed in to change notification settings - Fork 38.6k
qa: Add stopatheight test #10632
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
qa: Add stopatheight test #10632
Conversation
jonasschnelli
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.
ACK fa75f235f14c05c7d7d433396f4f49809860340d
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.
Tested ACK fa75f235f14c05c7d7d433396f4f49809860340d. Looks great!
Not sure that this entirely fits in blockchain.py, which is currently just for testing rpcs in rpc/blockchain.py. However, I can't think of any better place for it right now and it's definitely an improvement to have this test!
test/functional/blockchain.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.
micronit: The other subtests are defined in the order that they're called. Perhaps place this definition after the other subtests?
fac8c50 to
fac5a16
Compare
fac5a16 to
5555fa8
Compare
|
ACK 5555fa8 |
5555fa8 qa: Add stopatheight test (MarcoFalke) Tree-SHA512: ea3f318c3dc73a885db5e258f5d6a25e0017e2360a72ac5f6914bce6f7798d36aca45d2626aafd57ead744bd28fd38b561207a7a547a1d417e594976c35bccee
| assert_equal(self.nodes[0].getblockcount(), 206) | ||
| self.log.debug('Node should not stop at this height') | ||
| assert_raises(subprocess.TimeoutExpired, lambda: bitcoind_processes[0].wait(timeout=3)) | ||
| self.nodes[0].generate(1) |
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 believe this call to generate might fail -- isn't it possible the node's shutdown will interrupt the RPC response? That looks to me like what happened here:
https://travis-ci.org/bitcoin/bitcoin/jobs/245917226#L2275
I think we should wrap the generate(1) in a try...except and allow for the RPC to fail due to connection refused, etc.
5555fa8 qa: Add stopatheight test (MarcoFalke) Tree-SHA512: ea3f318c3dc73a885db5e258f5d6a25e0017e2360a72ac5f6914bce6f7798d36aca45d2626aafd57ead744bd28fd38b561207a7a547a1d417e594976c35bccee
Motivated by #10569