fix(tests): guard pool tests against epoch change - #3718
Merged
Merged
Conversation
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
requested
a balanced review from Copilot
and removed request for
saratomaz
September 29, 2026 12:31
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pool update tests query
future_pool_paramsand 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 stillupdate_epochright after querying the pool state.Increase
DEREG_BUFFER_SECto 40 so that a resubmitted cleanup deregistration tx doesn't cross the epoch boundary and get rejected withStakePoolRetirementWrongEpochPOOL.