Skip to content

fix(tests): guard pool tests against epoch change - #3718

Merged
mkoura merged 1 commit into
masterfrom
pool_update_epoch_check
Sep 29, 2026
Merged

mkoura merged 1 commit into
masterfrom
pool_update_epoch_check

Conversation

@mkoura

@mkoura mkoura commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

Pool update tests query future_pool_params and expect the update to be pending. When the update tx lands after an epoch boundary (e.g. a long empty-slot gap under load), the update is already applied and the check fails with a misleading data mismatch. Assert that the epoch is still update_epoch right after querying the pool state.

Increase DEREG_BUFFER_SEC to 40 so that a resubmitted cleanup deregistration tx doesn't cross the epoch boundary and get rejected with StakePoolRetirementWrongEpochPOOL.

Pool update tests query `future_pool_params` and expect the update to
be pending. When the update tx lands after an epoch boundary (e.g. a
long empty-slot gap under load), the update is already applied and the
check fails with a misleading data mismatch. Assert that the epoch is
still `update_epoch` right after querying the pool state.

Increase `DEREG_BUFFER_SEC` to 40 so that a resubmitted cleanup
deregistration tx doesn't cross the epoch boundary and get rejected
with `StakePoolRetirementWrongEpochPOOL`.
@mkoura
mkoura requested a review from saratomaz as a code owner September 29, 2026 12:31
@mkoura
mkoura requested a balanced review from Copilot and removed request for saratomaz September 29, 2026 12:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The changes directly address the described timing failures without introducing unresolved issues.

Review effort: Balanced
Findings: None

What changed in this PR

Guards pool-update assertions against epoch-boundary races and improves cleanup reliability.

Changes:

  • Verify the epoch remains unchanged after querying pending pool updates.
  • Increase the pool deregistration safety buffer to 40 seconds.
File Description
cardano_node_tests/​tests/​test_pools.py Adds epoch guards and adjusts the cleanup buffer.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@mkoura
mkoura merged commit a79f9b9 into master Sep 29, 2026
4 checks passed
@mkoura
mkoura deleted the pool_update_epoch_check branch September 29, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants