Skip to content

Commit b22021e

Browse files
committed
fix(pools): handle ledger#5365 in pool state tests
Add workaround for ledger issue #5365 where `queryPoolState` returns current pool params instead of future ones. Update pool update tests to detect this issue and skip the related assertion when present. Also, register the issue in the issues module.
1 parent f310b3a commit b22021e

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

cardano_node_tests/tests/issues.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,12 @@
191191
fixed_in="10.1.3.0", # Unknown yet, will be fixed/changed sometime in the future
192192
message="Delegation to DRep2 removed after retirement of DRep1.",
193193
)
194+
ledger_5365 = blockers.GH(
195+
issue=5365,
196+
repo="IntersectMBO/cardano-ledger",
197+
fixed_in="10.6.0.0",
198+
message="queryPoolState returns current pool params instead of the future ones.",
199+
)
194200

195201
node_3788 = blockers.GH(
196202
issue=3788,

cardano_node_tests/tests/test_pools.py

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
from cardano_node_tests.cluster_management import cluster_management
2525
from cardano_node_tests.tests import common
26+
from cardano_node_tests.tests import issues
2627
from cardano_node_tests.utils import cluster_nodes
2728
from cardano_node_tests.utils import clusterlib_utils
2829
from cardano_node_tests.utils import configuration
@@ -1466,12 +1467,12 @@ def test_update_stake_pool_metadata(
14661467
raise ValueError(msg)
14671468

14681469
# Check that pool is going to be updated with correct data
1469-
future_params = cluster.g_query.get_pool_state(
1470-
stake_pool_id=pool_creation_out.stake_pool_id
1471-
).future_pool_params
1472-
assert not clusterlib_utils.check_pool_data(
1473-
pool_params=future_params, pool_creation_data=pool_data_updated
1474-
)
1470+
pool_state = cluster.g_query.get_pool_state(stake_pool_id=pool_creation_out.stake_pool_id)
1471+
has_issue_5365 = pool_state.future_pool_params == pool_state.pool_params
1472+
if not has_issue_5365:
1473+
assert not clusterlib_utils.check_pool_data(
1474+
pool_params=pool_state.future_pool_params, pool_creation_data=pool_data_updated
1475+
)
14751476

14761477
if cluster.epoch_length_sec <= TWO_HOURS_SEC:
14771478
cluster.wait_for_epoch(epoch_no=update_epoch + 1, padding_seconds=5)
@@ -1483,6 +1484,9 @@ def test_update_stake_pool_metadata(
14831484
pool_data=pool_data_updated,
14841485
)
14851486

1487+
if has_issue_5365:
1488+
issues.ledger_5365.finish_test()
1489+
14861490
@allure.link(helpers.get_vcs_link())
14871491
@common.PARAM_BUILD_METHOD_NO_EST
14881492
@pytest.mark.testnets
@@ -1590,12 +1594,12 @@ def test_update_stake_pool_parameters(
15901594
raise ValueError(msg)
15911595

15921596
# Check that pool is going to be updated with correct data
1593-
future_params = cluster.g_query.get_pool_state(
1594-
stake_pool_id=pool_creation_out.stake_pool_id
1595-
).future_pool_params
1596-
assert not clusterlib_utils.check_pool_data(
1597-
pool_params=future_params, pool_creation_data=pool_data_updated
1598-
)
1597+
pool_state = cluster.g_query.get_pool_state(stake_pool_id=pool_creation_out.stake_pool_id)
1598+
has_issue_5365 = pool_state.future_pool_params == pool_state.pool_params
1599+
if not has_issue_5365:
1600+
assert not clusterlib_utils.check_pool_data(
1601+
pool_params=pool_state.future_pool_params, pool_creation_data=pool_data_updated
1602+
)
15991603

16001604
if cluster.epoch_length_sec <= TWO_HOURS_SEC:
16011605
cluster.wait_for_epoch(epoch_no=update_epoch + 1, padding_seconds=5)
@@ -1607,6 +1611,9 @@ def test_update_stake_pool_parameters(
16071611
pool_data=pool_data_updated,
16081612
)
16091613

1614+
if has_issue_5365:
1615+
issues.ledger_5365.finish_test()
1616+
16101617
@allure.link(helpers.get_vcs_link())
16111618
@pytest.mark.testnets
16121619
@pytest.mark.smoke

0 commit comments

Comments
 (0)