Skip to content

Commit

Permalink
Merge bitcoin/bitcoin#31746: test: Added coverage to the waitfornewbl…
Browse files Browse the repository at this point in the history
…ock rpc

93747d9 test: Added coverage to the waitfornewblock rpc (kevkevinpal)

Pull request description:

  Added a test for the Negative timeout error if the rpc is given a negative value for its timeout arg

  This adds coverage to the `waitfornewblock` rpc

  you can check to see there is no coverage for this error by doing
  `grep -nri "Negative timeout" ./test/`

  and nothing shows up, you can also see by manually checking where we call `waitfornewblock` in the functional tests

ACKs for top commit:
  Sjors:
    tACK 93747d9
  achow101:
    ACK 93747d9
  brunoerg:
    code review ACK 93747d9
  tdb3:
    ACK 93747d9

Tree-SHA512: 45cf34312412d3691a39f003bcd54791ea16542aa3f5a2674d7499c9cc4039550b2cbd32cc3d4c5fe100d65cb05690594b10a0c42dfab63bcca3dac121bb195b
  • Loading branch information
achow101 committed Jan 31, 2025
2 parents 992f37f + 93747d9 commit eaf4b92
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/functional/rpc_blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ def _test_waitforblock(self):
# The chain has probably already been restored by the time reconsiderblock returns,
# but poll anyway.
self.wait_until(lambda: node.waitfornewblock(timeout=100)['hash'] == current_hash)
assert_raises_rpc_error(-1, "Negative timeout", node.waitfornewblock, -1)

def _test_waitforblockheight(self):
self.log.info("Test waitforblockheight")
Expand Down

0 comments on commit eaf4b92

Please sign in to comment.