Adapt some tests to the recent limit_consensus_modes mark (#16220)

Adapt some tests to the recent limit_consensus_modes mark.
This commit is contained in:
Amine Khaldi 2023-09-01 18:17:10 +01:00 committed by GitHub
parent f5f9138470
commit 09f5873eb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View File

@ -1366,10 +1366,16 @@ class TestBlockHeaderValidation:
return None
attempts += 1
@pytest.mark.limit_consensus_modes(
allowed=[
ConsensusMode.PLAIN,
ConsensusMode.HARD_FORK_2_0,
ConsensusMode.SOFT_FORK3,
],
reason="Skipped ConsensusMode.SOFT_FORK4 temporarily until adding more pool plots.",
)
@pytest.mark.asyncio
async def test_pool_target_contract(self, empty_blockchain, bt, consensus_mode: ConsensusMode):
if consensus_mode == ConsensusMode.SOFT_FORK4:
pytest.skip("Skipped temporarily until adding more pool plots.")
# 20c invalid pool target with contract
blocks_initial = bt.get_consecutive_blocks(2)
await _validate_and_add_block(empty_blockchain, blocks_initial[0])

View File

@ -415,12 +415,11 @@ class TestFullSync:
duration = time.time() - start
assert duration > 5
@pytest.mark.limit_consensus_modes(reason="save time")
@pytest.mark.asyncio
async def test_bad_peak_in_cache(
self, two_nodes, default_400_blocks, blockchain_constants, self_hostname, consensus_mode
):
if consensus_mode != ConsensusMode.PLAIN:
pytest.skip("Skipped test")
full_node_1, full_node_2, server_1, server_2, bt = two_nodes
bt.constants = blockchain_constants.replace(SOFT_FORK4_HEIGHT=1000000)
blocks = bt.get_consecutive_blocks(700, default_400_blocks)
@ -439,12 +438,11 @@ class TestFullSync:
wp = await full_node_2.full_node.weight_proof_handler.get_proof_of_weight(peak.header_hash)
assert full_node_1.full_node.in_bad_peak_cache(wp) is True
@pytest.mark.limit_consensus_modes(reason="save time")
@pytest.mark.asyncio
async def test_skip_bad_peak_validation(
self, two_nodes, default_400_blocks, blockchain_constants, self_hostname, consensus_mode
):
if consensus_mode != ConsensusMode.PLAIN:
pytest.skip("Skipped test")
full_node_1, full_node_2, server_1, server_2, bt = two_nodes
blocks = bt.get_consecutive_blocks(700, default_400_blocks)
full_node_2.full_node.blockchain.constants = blockchain_constants.replace(SOFT_FORK4_HEIGHT=1000000)