From 19681d0f45b218887fed7d6ac3df1f6efb558a13 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Fri, 9 Feb 2024 20:35:33 +0300 Subject: [PATCH] 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)_ --- test/functional/feature_dip3_v19.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/functional/feature_dip3_v19.py b/test/functional/feature_dip3_v19.py index 56d7100e27cd7..189702337e9d2 100755 --- a/test/functional/feature_dip3_v19.py +++ b/test/functional/feature_dip3_v19.py @@ -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") @@ -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]) @@ -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: