Skip to content

Commit

Permalink
Merge bitcoin#22707: test: refactor use of getrawmempool in functiona…
Browse files Browse the repository at this point in the history
…l tests for efficiency

47c48b5 test: only use verbose for getrawmempool when necessary in functional tests (Michael Dietz)
7734971 test: use getmempoolentry instead of getrawmempool in functional tests when appropriate (Michael Dietz)
86dbd54 test: improve mempool_updatefrom efficiency by using getmempoolentry for specific txns (Michael Dietz)

Pull request description:

  I don't think this changes the intention of the test. But it does shave ~30 seconds off the time it takes to run. From what I've seen our CI `macOS 11 native [gui] [no depends]` runs `mempool_updatefrom.py` in ~135 seconds. After this PR it should run in ~105 seconds

  I noticed this improvement should probably be made when testing performance/runtimes of bitcoin#22698. But I wanted to separate this out from that PR so the affects of each is decoupled

  Edit: The major change in this PR is improving mempool_updatefrom.py's runtime as this is a very long running test. Then made the same efficiency improvements across all the functional tests as it made since to do that here

ACKs for top commit:
  theStack:
    Tested ACK 47c48b5

Tree-SHA512: 40f553715f3d4649dc18c2738554eafaca9ea800c4b028c099217896cc1c466ff457ae814d59cf8564c782a8964d8fac3eda60c1b6ffb08bbee1439b2d34434b
  • Loading branch information
MarcoFalke authored and PastaPastaPasta committed Feb 17, 2025
1 parent 078a791 commit 7f53669
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions test/functional/mempool_unbroadcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ def test_broadcast(self):

self.log.info("Rebroadcast transaction and ensure it is not added to unbroadcast set when already in mempool")
rpc_tx_hsh = node.sendrawtransaction(txFS["hex"])
mempool = node.getrawmempool(True)
assert rpc_tx_hsh in mempool
assert not mempool[rpc_tx_hsh]['unbroadcast']
assert not node.getmempoolentry(rpc_tx_hsh)['unbroadcast']

def test_txn_removal(self):
self.log.info("Test that transactions removed from mempool are removed from unbroadcast set")
Expand Down

0 comments on commit 7f53669

Please sign in to comment.