fix: intermittent failure in feature_dip3_v19.py (#5863)

## Issue being fixed or feature implemented
Fix failures like https://gitlab.com/dashpay/dash/-/jobs/6120923632

## What was done?
Handle disconnects and reconnection of the revoked MN in the right
place.

## How Has This Been Tested?
Run multiple `feature_dip3_v19.py` in parallel a few times

## Breaking Changes
n/a

## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository
code-owners and collaborators only)_
This commit is contained in:
UdjinM6 2024-02-09 20:35:33 +03:00 committed by GitHub
parent 8ea9c40655
commit 19681d0f45
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -107,11 +107,9 @@ class DIP3V19Test(DashTestFramework):
revoke_protx = self.mninfo[-1].proTxHash revoke_protx = self.mninfo[-1].proTxHash
revoke_keyoperator = self.mninfo[-1].keyOperator revoke_keyoperator = self.mninfo[-1].keyOperator
self.log.info(f"Trying to revoke proTx:{revoke_protx}") self.log.info(f"Trying to revoke proTx:{revoke_protx}")
self.test_revoke_protx(revoke_protx, revoke_keyoperator) self.test_revoke_protx(evo_info_3.nodeIdx, revoke_protx, revoke_keyoperator)
self.mine_quorum(llmq_type_name='llmq_test', llmq_type=100) self.mine_quorum(llmq_type_name='llmq_test', llmq_type=100)
# revoking a MN results in disconnects, reconnect it back to let sync_blocks finish correctly
self.connect_nodes(evo_info_3.nodeIdx, 0)
self.log.info("Checking that adding more regular MNs after v19 doesn't break DKGs and IS/CLs") self.log.info("Checking that adding more regular MNs after v19 doesn't break DKGs and IS/CLs")
@ -127,7 +125,7 @@ class DIP3V19Test(DashTestFramework):
self.wait_for_chainlocked_block_all_nodes(self.nodes[0].getbestblockhash()) self.wait_for_chainlocked_block_all_nodes(self.nodes[0].getbestblockhash())
def test_revoke_protx(self, revoke_protx, revoke_keyoperator): def test_revoke_protx(self, node_idx, revoke_protx, revoke_keyoperator):
funds_address = self.nodes[0].getnewaddress() funds_address = self.nodes[0].getnewaddress()
fund_txid = self.nodes[0].sendtoaddress(funds_address, 1) fund_txid = self.nodes[0].sendtoaddress(funds_address, 1)
self.wait_for_instantlock(fund_txid, self.nodes[0]) self.wait_for_instantlock(fund_txid, self.nodes[0])
@ -139,6 +137,10 @@ class DIP3V19Test(DashTestFramework):
self.wait_for_instantlock(protx_result, self.nodes[0]) self.wait_for_instantlock(protx_result, self.nodes[0])
tip = self.nodes[0].generate(1)[0] tip = self.nodes[0].generate(1)[0]
assert_equal(self.nodes[0].getrawtransaction(protx_result, 1, tip)['confirmations'], 1) assert_equal(self.nodes[0].getrawtransaction(protx_result, 1, tip)['confirmations'], 1)
# Revoking a MN results in disconnects. Wait for disconnects to actually happen
# and then reconnect the corresponding node back to let sync_blocks finish correctly.
self.wait_until(lambda: self.nodes[node_idx].getconnectioncount() == 0)
self.connect_nodes(node_idx, 0)
self.sync_all(self.nodes) self.sync_all(self.nodes)
self.log.info(f"Succesfully revoked={revoke_protx}") self.log.info(f"Succesfully revoked={revoke_protx}")
for mn in self.mninfo: for mn in self.mninfo: