mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 11:32:46 +01:00
chore: increase batch size from 10 to 50 for faster block generation in functional tests
It significantly improve speed of forks activation because reduces overhead for block generations Bigger batch size can cause time-outs for RPC for tsan job (time-out is 30 seconds)
This commit is contained in:
parent
a9a2d4adbe
commit
4c57ad1c05
@ -219,11 +219,11 @@ class AssetLocksTest(DashTestFramework):
|
||||
except JSONRPCException as e:
|
||||
assert expected_error in e.error['message']
|
||||
|
||||
def slowly_generate_batch(self, count):
|
||||
self.log.info(f"Slowly generate {count} blocks")
|
||||
def generate_batch(self, count):
|
||||
self.log.info(f"Generate {count} blocks")
|
||||
while count > 0:
|
||||
self.log.info(f"Generating batch of blocks {count} left")
|
||||
batch = min(10, count)
|
||||
batch = min(50, count)
|
||||
count -= batch
|
||||
self.bump_mocktime(batch)
|
||||
self.nodes[1].generate(batch)
|
||||
@ -426,7 +426,7 @@ class AssetLocksTest(DashTestFramework):
|
||||
self.validate_credit_pool_balance(locked - 2 * COIN)
|
||||
|
||||
self.log.info("Generating many blocks to make quorum far behind (even still active)...")
|
||||
self.slowly_generate_batch(too_late_height - node.getblockcount() - 1)
|
||||
self.generate_batch(too_late_height - node.getblockcount() - 1)
|
||||
self.check_mempool_result(tx=asset_unlock_tx_too_late, result_expected={'allowed': True, 'fees': {'base': Decimal(str(tiny_amount / COIN))}})
|
||||
node.generate(1)
|
||||
self.sync_all()
|
||||
@ -444,7 +444,7 @@ class AssetLocksTest(DashTestFramework):
|
||||
for inode in self.nodes:
|
||||
inode.invalidateblock(block_asset_unlock)
|
||||
self.validate_credit_pool_balance(locked)
|
||||
self.slowly_generate_batch(50)
|
||||
self.generate_batch(50)
|
||||
self.validate_credit_pool_balance(locked)
|
||||
for inode in self.nodes:
|
||||
inode.reconsiderblock(block_to_reconsider)
|
||||
@ -510,7 +510,7 @@ class AssetLocksTest(DashTestFramework):
|
||||
assert spend_txid_in_block in block['tx']
|
||||
|
||||
self.log.info("Fast forward to the next day to reset all current unlock limits...")
|
||||
self.slowly_generate_batch(blocks_in_one_day)
|
||||
self.generate_batch(blocks_in_one_day)
|
||||
self.mine_quorum_2_nodes(llmq_type_name='llmq_test_platform', llmq_type=106)
|
||||
|
||||
total = self.get_credit_pool_balance()
|
||||
@ -585,7 +585,7 @@ class AssetLocksTest(DashTestFramework):
|
||||
assert pending_txid in node.getrawmempool()
|
||||
|
||||
self.log.info("Fast forward to next day again...")
|
||||
self.slowly_generate_batch(blocks_in_one_day - 1)
|
||||
self.generate_batch(blocks_in_one_day - 1)
|
||||
self.log.info("Checking mempool is empty now...")
|
||||
self.mempool_size = 0
|
||||
self.check_mempool_size()
|
||||
@ -618,7 +618,7 @@ class AssetLocksTest(DashTestFramework):
|
||||
|
||||
|
||||
self.log.info("generate many blocks to be sure that mempool is empty after expiring txes...")
|
||||
self.slowly_generate_batch(60)
|
||||
self.generate_batch(60)
|
||||
self.log.info("Checking that credit pool is not changed...")
|
||||
assert_equal(new_total, self.get_credit_pool_balance())
|
||||
self.check_mempool_size()
|
||||
|
@ -1136,7 +1136,7 @@ class DashTestFramework(BitcoinTestFramework):
|
||||
self.wait_for_sporks_same()
|
||||
|
||||
# mine blocks in batches
|
||||
batch_size = 10
|
||||
batch_size = 50
|
||||
if expected_activation_height is not None:
|
||||
height = self.nodes[0].getblockcount()
|
||||
assert height < expected_activation_height
|
||||
|
Loading…
Reference in New Issue
Block a user