Follow-up to #22407 improving test coverage per #22407#pullrequestreview-702077013.
test: improve rpc_blockchain.py tests and assert on time and mediantime #22520
pull jonatack wants to merge 4 commits into bitcoin:master from jonatack:getblockchaininfo-time-tests changing 1 files +49 −37-
jonatack commented at 3:43 PM on July 21, 2021: member
-
test: assert on the value of getblockchaininfo#time 0a9129c588
-
test: assert on mediantime in getblockheader and getblockchaininfo 78c361086f
- DrahtBot added the label Tests on Jul 21, 2021
- jonatack force-pushed on Jul 21, 2021
- jonatack renamed this:
test: assert on the values of getblockchaininfo time/mediantime
test: improve rpc_blockchain.py tests and assert on time and mediantime
on Jul 21, 2021 -
in test/functional/rpc_blockchain.py:110 in dd476e7bba outdated
105 | @@ -99,7 +106,8 @@ def _test_getblockchaininfo(self): 106 | ] 107 | res = self.nodes[0].getblockchaininfo() 108 | 109 | - assert isinstance(res['time'], int) 110 | + assert_equal(res['time'], TIME_RANGE_END - TIME_RANGE_STEP) 111 | + assert_equal(res['mediantime'], TIME_RANGE_MTP)
RandyMcMillan commented at 6:26 PM on July 21, 2021:It would be interesting if the TIME_RANGE_STEP varied quasi-randomly by +/- 3 minutes. Wouldn't having a variation be a better test? Just a thought. :)
jonatack commented at 12:52 AM on July 22, 2021:The
getnetworkhashpstest would need to be adapted to it, otherwise seems doable. Feel free to propose it as a follow-up!test: replace magic values by constants in rpc_blockchain.py d548dc71e4test: update logging and docstring in rpc_blockchain.py ef5e9304cdjonatack force-pushed on Jul 22, 2021jonatack commented at 12:54 AM on July 22, 2021: memberUpdated per
git diff dd476e7 ef5e930for a few more changes to be made in the third commit, "test: replace magic values by constants in rpc_blockchain.py."DrahtBot commented at 10:50 AM on July 28, 2021: member<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #22567 by MarcoFalke
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
MarcoFalke merged this on Jul 30, 2021MarcoFalke closed this on Jul 30, 2021jonatack deleted the branch on Jul 30, 2021sidhujag referenced this in commit 111592ed6c on Aug 1, 2021DrahtBot locked this on Aug 16, 2022ContributorsLabels
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-13 15:14 UTC
More mirrored repositories can be found on mirror.b10c.me