Motivated by #10569
qa: Add stopatheight test #10632
pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:Mf1706-qaStopAtHeight changing 1 files +19 −1-
MarcoFalke commented at 7:24 PM on June 19, 2017: member
- MarcoFalke added the label Tests on Jun 19, 2017
- jonasschnelli approved
-
jonasschnelli commented at 6:05 AM on June 20, 2017: contributor
ACK fa75f235f14c05c7d7d433396f4f49809860340d
-
in test/functional/blockchain.py:51 in fa75f235f1 outdated
47 | self._test_getnetworkhashps() 48 | - self.nodes[0].verifychain(4, 0) 49 | + self._test_stopatheight() 50 | + assert self.nodes[0].verifychain(4, 0) 51 | + 52 | + def _test_stopatheight(self):
jnewbery commented at 8:59 AM on June 20, 2017:micronit: The other subtests are defined in the order that they're called. Perhaps place this definition after the other subtests?
jnewbery commented at 9:02 AM on June 20, 2017: memberTested 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!
MarcoFalke force-pushed on Jun 20, 2017MarcoFalke force-pushed on Jun 20, 2017qa: Add stopatheight test 5555fa8b74MarcoFalke force-pushed on Jun 20, 2017achow101 commented at 1:33 AM on June 22, 2017: memberACK 5555fa8b74bc3c8e68232acbf4c54b9a8fadb8f2
MarcoFalke merged this on Jun 22, 2017MarcoFalke closed this on Jun 22, 2017MarcoFalke referenced this in commit c68a9a6927 on Jun 22, 2017MarcoFalke deleted the branch on Jun 22, 2017in test/functional/blockchain.py:143 in 5555fa8b74
138 | + assert_equal(self.nodes[0].getblockcount(), 200) 139 | + self.nodes[0].generate(6) 140 | + assert_equal(self.nodes[0].getblockcount(), 206) 141 | + self.log.debug('Node should not stop at this height') 142 | + assert_raises(subprocess.TimeoutExpired, lambda: bitcoind_processes[0].wait(timeout=3)) 143 | + self.nodes[0].generate(1)
sdaftuar commented at 1:47 AM on June 23, 2017: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.
PastaPastaPasta referenced this in commit 0d029a23d2 on Jul 6, 2019PastaPastaPasta referenced this in commit ebb10db19e on Jul 8, 2019PastaPastaPasta referenced this in commit 1a1b5cff49 on Jul 9, 2019PastaPastaPasta referenced this in commit 43c952d2eb on Jul 11, 2019barrystyle referenced this in commit 72cac97790 on Jan 22, 2020DrahtBot locked this on Sep 8, 2021
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 21:15 UTC
More mirrored repositories can be found on mirror.b10c.me