This is a PR proposed in #20078
This PR enables one more of the non-wallet functional tests (mempool_updatefromblock.py) to be run even with the Bitcoin Core wallet disabled by using the new MiniWallet instead.
Overview:
- Refactoring and removal of unnecessary imports and arguments to transaction_graph_test()
- Improve logging
- Decrease test execution time by ~70% (39s => 12s)
Before:
0[USER@SERVER functional]$ time ./mempool_updatefromblock.py
12021-05-19T21:02:10.809000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_42xs1s0g
22021-05-19T21:02:11.154000Z TestFramework (INFO): Creating 100 transactions...
32021-05-19T21:02:15.741000Z TestFramework (INFO): The batch of 25 transactions has been accepted into the mempool.
42021-05-19T21:02:15.756000Z TestFramework (INFO): All of the transactions from the current batch have been mined into a block.
52021-05-19T21:02:20.097000Z TestFramework (INFO): The batch of 25 transactions has been accepted into the mempool.
62021-05-19T21:02:20.115000Z TestFramework (INFO): All of the transactions from the current batch have been mined into a block.
72021-05-19T21:02:24.687000Z TestFramework (INFO): The batch of 25 transactions has been accepted into the mempool.
82021-05-19T21:02:24.705000Z TestFramework (INFO): All of the transactions from the current batch have been mined into a block.
92021-05-19T21:02:28.774000Z TestFramework (INFO): The last batch of 25 transactions has been accepted into the mempool.
102021-05-19T21:02:29.160000Z TestFramework (INFO): All of the recently mined transactions have been re-added into the mempool in 0.3855452537536621 seconds.
112021-05-19T21:02:29.161000Z TestFramework (INFO): Checking descendants/ancestors properties of all of the in-mempool transactions...
122021-05-19T21:02:50.455000Z TestFramework (INFO): Stopping nodes
132021-05-19T21:02:50.508000Z TestFramework (INFO): Cleaning up /tmp/bitcoin_func_test_42xs1s0g on exit
142021-05-19T21:02:50.508000Z TestFramework (INFO): Tests successful
15
16real 0m39.895s
17user 0m34.627s
18sys 0m2.474s
After:
0[USER@SERVER functional]$ time ./mempool_updatefromblock.py
12021-05-19T21:08:17.190000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test__3fuskkh
22021-05-19T21:08:17.493000Z TestFramework (INFO): Creating 100 transactions...
32021-05-19T21:08:17.634000Z TestFramework (INFO): The batch of 25 transactions has been accepted into the mempool.
42021-05-19T21:08:17.686000Z TestFramework (INFO): All of the transactions from the current batch have been mined into a block.
52021-05-19T21:08:17.771000Z TestFramework (INFO): The batch of 25 transactions has been accepted into the mempool.
62021-05-19T21:08:17.820000Z TestFramework (INFO): All of the transactions from the current batch have been mined into a block.
72021-05-19T21:08:17.896000Z TestFramework (INFO): The batch of 25 transactions has been accepted into the mempool.
82021-05-19T21:08:17.943000Z TestFramework (INFO): All of the transactions from the current batch have been mined into a block.
92021-05-19T21:08:18.009000Z TestFramework (INFO): The batch of 25 transactions has been accepted into the mempool.
102021-05-19T21:08:18.058000Z TestFramework (INFO): All of the transactions from the current batch have been mined into a block.
112021-05-19T21:08:18.060000Z TestFramework (INFO): Mempool size pre-invalidation: 0
122021-05-19T21:08:18.080000Z TestFramework (INFO): Mempool size post-invalidation: 100
132021-05-19T21:08:18.082000Z TestFramework (INFO): All of the recently mined transactions have been re-added into the mempool in 0.0179746150970459 seconds.
142021-05-19T21:08:18.082000Z TestFramework (INFO): Checking descendants/ancestors properties of all of the in-mempool transactions...
152021-05-19T21:08:29.441000Z TestFramework (INFO): Stopping nodes
162021-05-19T21:08:29.496000Z TestFramework (INFO): Cleaning up /tmp/bitcoin_func_test__3fuskkh on exit
172021-05-19T21:08:29.496000Z TestFramework (INFO): Tests successful
18
19real 0m12.465s
20user 0m5.843s
21sys 0m0.800s