Skip to content

Commit 1ddf79e

Browse files
authored
Merge pull request #1189 from mkoura/remove_currently_broken_xfails
Remove xfailures for "currently broken" commands
2 parents a40dfbc + eab2888 commit 1ddf79e

File tree

4 files changed

+77
-147
lines changed

4 files changed

+77
-147
lines changed

cardano_node_tests/tests/test_blocks.py

+5-17
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,11 @@ def test_pool_blocks(
7474
queried_epoch = cluster.get_epoch() + 1
7575

7676
# query leadership schedule for selected pool
77-
# TODO: the query is currently broken
78-
query_currently_broken = False
79-
try:
80-
leadership_schedule = cluster.get_leadership_schedule(
81-
vrf_skey_file=pool_rec["vrf_key_pair"].skey_file,
82-
cold_vkey_file=pool_rec["cold_key_pair"].vkey_file,
83-
for_next=for_epoch != "current",
84-
)
85-
except clusterlib.CLIError as err:
86-
if "currently broken" not in str(err):
87-
raise
88-
query_currently_broken = True
89-
if query_currently_broken:
90-
pytest.xfail("`query leadership-schedule` is currently broken")
77+
leadership_schedule = cluster.get_leadership_schedule(
78+
vrf_skey_file=pool_rec["vrf_key_pair"].skey_file,
79+
cold_vkey_file=pool_rec["cold_key_pair"].vkey_file,
80+
for_next=for_epoch != "current",
81+
)
9182

9283
# wait for epoch that comes after the queried epoch
9384
cluster.wait_for_new_epoch(new_epochs=1 if for_epoch == "current" else 2)
@@ -170,9 +161,6 @@ def test_unstable_stake_distribution(
170161
)
171162
err_str = str(excinfo.value)
172163

173-
# TODO: the query is currently broken
174-
if "currently broken" in err_str:
175-
pytest.xfail("`query leadership-schedule` is currently broken")
176164
if "PastHorizon" in err_str:
177165
pytest.xfail("`query leadership-schedule` is affected by cardano-node issue 4002")
178166

cardano_node_tests/tests/test_kes.py

+59-95
Original file line numberDiff line numberDiff line change
@@ -229,34 +229,23 @@ def _refresh_opcerts():
229229
time.sleep(120)
230230

231231
# check kes-period-info with an operational certificate with KES expired
232-
# TODO: the query is currently broken
233-
kes_query_currently_broken = False
234-
try:
235-
kes_info_expired = cluster.get_kes_period_info(
236-
opcert_file=expire_pool_rec["pool_operational_cert"]
232+
kes_info_expired = cluster.get_kes_period_info(
233+
opcert_file=expire_pool_rec["pool_operational_cert"]
234+
)
235+
kes.check_kes_period_info_result(
236+
kes_output=kes_info_expired, expected_scenario=kes.KesScenarios.INVALID_KES_PERIOD
237+
)
238+
239+
# check kes-period-info with valid operational certificates
240+
for n in refreshed_nodes:
241+
refreshed_pool_rec = cluster_manager.cache.addrs_data[f"node-{n}"]
242+
kes_info_valid = cluster.get_kes_period_info(
243+
opcert_file=refreshed_pool_rec["pool_operational_cert"]
237244
)
238-
except clusterlib.CLIError as err:
239-
if "currentlyBroken" not in str(err):
240-
raise
241-
kes_query_currently_broken = True
242-
243-
if kes_query_currently_broken:
244-
pytest.xfail("`query kes-period-info` is currently broken")
245-
else:
246245
kes.check_kes_period_info_result(
247-
kes_output=kes_info_expired, expected_scenario=kes.KesScenarios.INVALID_KES_PERIOD
246+
kes_output=kes_info_valid, expected_scenario=kes.KesScenarios.ALL_VALID
248247
)
249248

250-
# check kes-period-info with valid operational certificates
251-
for n in refreshed_nodes:
252-
refreshed_pool_rec = cluster_manager.cache.addrs_data[f"node-{n}"]
253-
kes_info_valid = cluster.get_kes_period_info(
254-
opcert_file=refreshed_pool_rec["pool_operational_cert"]
255-
)
256-
kes.check_kes_period_info_result(
257-
kes_output=kes_info_valid, expected_scenario=kes.KesScenarios.ALL_VALID
258-
)
259-
260249
@allure.link(helpers.get_vcs_link())
261250
@pytest.mark.order(6)
262251
@pytest.mark.long
@@ -325,8 +314,6 @@ def test_opcert_future_kes_period( # noqa: C901
325314
kes_period=cluster.get_kes_period() + 100,
326315
)
327316

328-
kes_query_currently_broken = False
329-
330317
with cluster_manager.restart_on_failure():
331318
with logfiles.expect_errors(expected_errors, ignore_file_id=cluster_manager.worker_id):
332319
# restart the node with the new operational certificate
@@ -351,19 +338,11 @@ def test_opcert_future_kes_period( # noqa: C901
351338
if invalid_opcert_epoch == 1:
352339
# check kes-period-info with operational certificate with
353340
# invalid `--kes-period`
354-
# TODO: the query is currently broken
355-
try:
356-
kes_period_info = cluster.get_kes_period_info(invalid_opcert_file)
357-
except clusterlib.CLIError as err:
358-
if "currentlyBroken" not in str(err):
359-
raise
360-
kes_query_currently_broken = True
361-
362-
if not kes_query_currently_broken:
363-
kes.check_kes_period_info_result(
364-
kes_output=kes_period_info,
365-
expected_scenario=kes.KesScenarios.INVALID_KES_PERIOD,
366-
)
341+
kes_period_info = cluster.get_kes_period_info(invalid_opcert_file)
342+
kes.check_kes_period_info_result(
343+
kes_output=kes_period_info,
344+
expected_scenario=kes.KesScenarios.INVALID_KES_PERIOD,
345+
)
367346

368347
# test the `CounterOverIncrementedOCERT` error - the counter will now be +2 from
369348
# last used opcert counter value
@@ -421,23 +400,20 @@ def test_opcert_future_kes_period( # noqa: C901
421400
f"The pool '{pool_name}' has not minted any blocks since epoch {updated_epoch}."
422401
)
423402

424-
if kes_query_currently_broken:
425-
pytest.xfail("`query kes-period-info` is currently broken")
426-
else:
427-
# check kes-period-info with valid operational certificate
428-
kes_period_info = cluster.get_kes_period_info(valid_opcert_file)
429-
kes.check_kes_period_info_result(
430-
kes_output=kes_period_info, expected_scenario=kes.KesScenarios.ALL_VALID
431-
)
403+
# check kes-period-info with valid operational certificate
404+
kes_period_info = cluster.get_kes_period_info(valid_opcert_file)
405+
kes.check_kes_period_info_result(
406+
kes_output=kes_period_info, expected_scenario=kes.KesScenarios.ALL_VALID
407+
)
432408

433-
# check kes-period-info with invalid operational certificate, wrong counter and period
434-
kes_period_info = cluster.get_kes_period_info(invalid_opcert_file)
435-
kes.check_kes_period_info_result(
436-
kes_output=kes_period_info,
437-
expected_scenario=kes.KesScenarios.INVALID_KES_PERIOD
438-
if VERSIONS.cluster_era > VERSIONS.ALONZO
439-
else kes.KesScenarios.ALL_INVALID,
440-
)
409+
# check kes-period-info with invalid operational certificate, wrong counter and period
410+
kes_period_info = cluster.get_kes_period_info(invalid_opcert_file)
411+
kes.check_kes_period_info_result(
412+
kes_output=kes_period_info,
413+
expected_scenario=kes.KesScenarios.INVALID_KES_PERIOD
414+
if VERSIONS.cluster_era > VERSIONS.ALONZO
415+
else kes.KesScenarios.ALL_INVALID,
416+
)
441417

442418
@allure.link(helpers.get_vcs_link())
443419
@pytest.mark.order(7)
@@ -499,27 +475,18 @@ def test_update_valid_opcert(
499475
time.sleep(10)
500476

501477
# check kes-period-info while the pool is not minting blocks
502-
# TODO: the query is currently broken
503-
kes_query_currently_broken = False
504-
try:
505-
kes_period_info_new = cluster.get_kes_period_info(opcert_file)
506-
except clusterlib.CLIError as err:
507-
if "currentlyBroken" not in str(err):
508-
raise
509-
kes_query_currently_broken = True
510-
511-
if not kes_query_currently_broken:
512-
kes.check_kes_period_info_result(
513-
kes_output=kes_period_info_new, expected_scenario=kes.KesScenarios.ALL_VALID
514-
)
515-
kes_period_info_old = cluster.get_kes_period_info(opcert_file_old)
516-
kes.check_kes_period_info_result(
517-
kes_output=kes_period_info_old, expected_scenario=kes.KesScenarios.ALL_VALID
518-
)
519-
assert (
520-
kes_period_info_new["metrics"]["qKesNodeStateOperationalCertificateNumber"]
521-
== kes_period_info_old["metrics"]["qKesNodeStateOperationalCertificateNumber"]
522-
)
478+
kes_period_info_new = cluster.get_kes_period_info(opcert_file)
479+
kes.check_kes_period_info_result(
480+
kes_output=kes_period_info_new, expected_scenario=kes.KesScenarios.ALL_VALID
481+
)
482+
kes_period_info_old = cluster.get_kes_period_info(opcert_file_old)
483+
kes.check_kes_period_info_result(
484+
kes_output=kes_period_info_old, expected_scenario=kes.KesScenarios.ALL_VALID
485+
)
486+
assert (
487+
kes_period_info_new["metrics"]["qKesNodeStateOperationalCertificateNumber"]
488+
== kes_period_info_old["metrics"]["qKesNodeStateOperationalCertificateNumber"]
489+
)
523490

524491
# start the node with the new operational certificate
525492
cluster_nodes.start_nodes([node_name])
@@ -543,26 +510,23 @@ def test_update_valid_opcert(
543510
f"The pool '{pool_name}' has not minted any blocks since epoch {updated_epoch}."
544511
)
545512

546-
if kes_query_currently_broken:
547-
pytest.xfail("`query kes-period-info` is currently broken")
548-
else:
549-
# check that metrics reported by kes-period-info got updated once the pool started
550-
# minting blocks again
551-
kes_period_info_updated = cluster.get_kes_period_info(opcert_file)
552-
kes.check_kes_period_info_result(
553-
kes_output=kes_period_info_updated, expected_scenario=kes.KesScenarios.ALL_VALID
554-
)
555-
assert (
556-
kes_period_info_updated["metrics"]["qKesNodeStateOperationalCertificateNumber"]
557-
!= kes_period_info_old["metrics"]["qKesNodeStateOperationalCertificateNumber"]
558-
)
513+
# check that metrics reported by kes-period-info got updated once the pool started
514+
# minting blocks again
515+
kes_period_info_updated = cluster.get_kes_period_info(opcert_file)
516+
kes.check_kes_period_info_result(
517+
kes_output=kes_period_info_updated, expected_scenario=kes.KesScenarios.ALL_VALID
518+
)
519+
assert (
520+
kes_period_info_updated["metrics"]["qKesNodeStateOperationalCertificateNumber"]
521+
!= kes_period_info_old["metrics"]["qKesNodeStateOperationalCertificateNumber"]
522+
)
559523

560-
# check kes-period-info with operational certificate with a wrong counter
561-
kes_period_info_invalid = cluster.get_kes_period_info(opcert_file_old)
562-
kes.check_kes_period_info_result(
563-
kes_output=kes_period_info_invalid,
564-
expected_scenario=kes.KesScenarios.INVALID_COUNTERS,
565-
)
524+
# check kes-period-info with operational certificate with a wrong counter
525+
kes_period_info_invalid = cluster.get_kes_period_info(opcert_file_old)
526+
kes.check_kes_period_info_result(
527+
kes_output=kes_period_info_invalid,
528+
expected_scenario=kes.KesScenarios.INVALID_COUNTERS,
529+
)
566530

567531
@allure.link(helpers.get_vcs_link())
568532
def test_no_kes_period_arg(

cardano_node_tests/tests/test_protocol.py

+1-12
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,7 @@ class TestProtocol:
5656
def test_protocol_state_keys(self, cluster: clusterlib.ClusterLib):
5757
"""Check output of `query protocol-state`."""
5858
common.get_test_id(cluster)
59-
60-
# TODO: the query is currently broken
61-
query_currently_broken = False
62-
try:
63-
protocol_state = cluster.get_protocol_state()
64-
except clusterlib.CLIError as err:
65-
if "currentlyBroken" not in str(err):
66-
raise
67-
query_currently_broken = True
68-
if query_currently_broken:
69-
pytest.xfail("`query protocol-state` is currently broken")
70-
59+
protocol_state = cluster.get_protocol_state()
7160
assert tuple(sorted(protocol_state)) == PROTOCOL_STATE_KEYS
7261

7362
@allure.link(helpers.get_vcs_link())

cardano_node_tests/tests/test_staking_no_rewards.py

+12-23
Original file line numberDiff line numberDiff line change
@@ -823,19 +823,10 @@ def test_deregister_reward_addr_retire_pool( # noqa: C901
823823
).pool_params, f"The pool {pool_id} was not deregistered"
824824

825825
# check command kes-period-info case: de-register pool
826-
# TODO: the query is currently broken
827-
kes_query_currently_broken = False
828-
try:
829-
kes_period_info = cluster.get_kes_period_info(pool_opcert_file)
830-
except clusterlib.CLIError as err:
831-
if "currentlyBroken" not in str(err):
832-
raise
833-
kes_query_currently_broken = True
834-
835-
if not kes_query_currently_broken:
836-
kes.check_kes_period_info_result(
837-
kes_output=kes_period_info, expected_scenario=kes.KesScenarios.ALL_VALID
838-
)
826+
kes_period_info = cluster.get_kes_period_info(pool_opcert_file)
827+
kes.check_kes_period_info_result(
828+
kes_output=kes_period_info, expected_scenario=kes.KesScenarios.ALL_VALID
829+
)
839830

840831
# check that the balance for source address was correctly updated
841832
assert src_dereg_balance - tx_raw_output.fee == cluster.get_address_balance(
@@ -880,11 +871,10 @@ def test_deregister_reward_addr_retire_pool( # noqa: C901
880871

881872
# check command kes-period-info case: re-register pool, check without
882873
# waiting to take effect
883-
if not kes_query_currently_broken:
884-
kes_period_info = cluster.get_kes_period_info(pool_opcert_file)
885-
kes.check_kes_period_info_result(
886-
kes_output=kes_period_info, expected_scenario=kes.KesScenarios.ALL_VALID
887-
)
874+
kes_period_info = cluster.get_kes_period_info(pool_opcert_file)
875+
kes.check_kes_period_info_result(
876+
kes_output=kes_period_info, expected_scenario=kes.KesScenarios.ALL_VALID
877+
)
888878

889879
# check that the balance for source address was correctly updated and that the
890880
# pool deposit was needed
@@ -905,11 +895,10 @@ def test_deregister_reward_addr_retire_pool( # noqa: C901
905895
raise AssertionError(f"Stake pool `{pool_id}` not registered even after 5 epochs.")
906896

907897
# check command kes-period-info case: re-register pool
908-
if not kes_query_currently_broken:
909-
kes_period_info = cluster.get_kes_period_info(pool_opcert_file)
910-
kes.check_kes_period_info_result(
911-
kes_output=kes_period_info, expected_scenario=kes.KesScenarios.ALL_VALID
912-
)
898+
kes_period_info = cluster.get_kes_period_info(pool_opcert_file)
899+
kes.check_kes_period_info_result(
900+
kes_output=kes_period_info, expected_scenario=kes.KesScenarios.ALL_VALID
901+
)
913902

914903
# wait before checking delegation and rewards
915904
cluster.wait_for_new_epoch(3, padding_seconds=30)

0 commit comments

Comments
 (0)