Skip to content

Commit

Permalink
Check block production for more epochs
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoura committed Jun 24, 2022
1 parent 7e8f249 commit c5c1f3c
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions cardano_node_tests/tests/test_kes.py
Expand Up @@ -402,11 +402,10 @@ def test_opcert_future_kes_period( # noqa: C901
shutil.copy(valid_opcert_file, opcert_file)
cluster_nodes.restart_nodes([node_name])

LOGGER.info("Checking blocks production for another 2 epochs.")
blocks_made_db = []
LOGGER.info("Checking blocks production for up to 3 epochs.")
updated_epoch = cluster.get_epoch()
this_epoch = updated_epoch
for __ in range(2):
for __ in range(3):
this_epoch, is_minting = _check_block_production(
cluster_obj=cluster,
temp_template=temp_template,
Expand All @@ -415,11 +414,12 @@ def test_opcert_future_kes_period( # noqa: C901
)

# check that the pool is minting blocks
blocks_made_db.append(is_minting)

assert any(
blocks_made_db
), f"The pool '{pool_name}' has not produced any blocks since epoch {updated_epoch}"
if is_minting:
break
else:
raise AssertionError(
f"The pool '{pool_name}' has not minted any blocks since epoch {updated_epoch}."
)

if kes_query_currently_broken:
pytest.xfail("`query kes-period-info` is currently broken")
Expand Down Expand Up @@ -524,11 +524,10 @@ def test_update_valid_opcert(
# start the node with the new operational certificate
cluster_nodes.start_nodes([node_name])

LOGGER.info("Checking blocks production for 2 epochs.")
blocks_made_db = []
LOGGER.info("Checking blocks production for up to 3 epochs.")
updated_epoch = cluster.get_epoch()
this_epoch = updated_epoch
for __ in range(2):
for __ in range(3):
this_epoch, is_minting = _check_block_production(
cluster_obj=cluster,
temp_template=temp_template,
Expand All @@ -537,11 +536,12 @@ def test_update_valid_opcert(
)

# check that the pool is minting blocks
blocks_made_db.append(is_minting)

assert any(
blocks_made_db
), f"The pool '{pool_name}' has not minted any blocks since epoch {updated_epoch}"
if is_minting:
break
else:
raise AssertionError(
f"The pool '{pool_name}' has not minted any blocks since epoch {updated_epoch}."
)

if kes_query_currently_broken:
pytest.xfail("`query kes-period-info` is currently broken")
Expand Down

0 comments on commit c5c1f3c

Please sign in to comment.