Skip to content

Commit

Permalink
fix: intermittent failure in feature_dip3_v19.py (#5863)
Browse files Browse the repository at this point in the history
## 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)_
  • Loading branch information
UdjinM6 authored Feb 9, 2024
1 parent 8ea9c40 commit 19681d0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/functional/feature_dip3_v19.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,9 @@ def run_test(self):
revoke_protx = self.mninfo[-1].proTxHash
revoke_keyoperator = self.mninfo[-1].keyOperator
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)
# 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")

Expand All @@ -127,7 +125,7 @@ def run_test(self):

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()
fund_txid = self.nodes[0].sendtoaddress(funds_address, 1)
self.wait_for_instantlock(fund_txid, self.nodes[0])
Expand All @@ -139,6 +137,10 @@ def test_revoke_protx(self, revoke_protx, revoke_keyoperator):
self.wait_for_instantlock(protx_result, self.nodes[0])
tip = self.nodes[0].generate(1)[0]
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.log.info(f"Succesfully revoked={revoke_protx}")
for mn in self.mninfo:
Expand Down

0 comments on commit 19681d0

Please sign in to comment.