diff --git a/test/functional/abc_p2p_avalanche_voting.py b/test/functional/abc_p2p_avalanche_voting.py --- a/test/functional/abc_p2p_avalanche_voting.py +++ b/test/functional/abc_p2p_avalanche_voting.py @@ -197,7 +197,8 @@ return node.getbestblockhash() == tip_expected # Because everybody answers yes, the node will accept that block. - self.wait_until(lambda: has_accepted_tip(fork_tip)) + with node.assert_debug_log([f"Avalanche accepted block {fork_tip}"]): + self.wait_until(lambda: has_accepted_tip(fork_tip)) def has_finalized_tip(tip_expected): hash_tip_final = int(tip_expected, 16) @@ -230,6 +231,15 @@ self.wait_until(lambda: has_parked_tip(tip_to_park)) assert_equal(node.getbestblockhash(), fork_tip) + # Voting yes will switch to accepting the block. + with node.assert_debug_log([f"Avalanche accepted block {tip_to_park}"]): + self.wait_until(lambda: has_accepted_tip(tip_to_park)) + + # Answer no again and switch back to rejecting the block. + with node.assert_debug_log([f"Avalanche rejected block {tip_to_park}"]): + self.wait_until(lambda: has_parked_tip(tip_to_park)) + assert_equal(node.getbestblockhash(), fork_tip) + # Vote a few more times until the block gets invalidated hash_tip_park = int(tip_to_park, 16) node.wait_for_debug_log(