test(cketh): Add retry mechanism to assert_has_unique_events_in_order#10099
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the ckETH test utilities to make event-order assertions robust to recent changes in message execution timing by retrying the assertion after advancing the state machine.
Changes:
- Add a retry loop with
env.tick()when asserting events are unique and in-order, to allow delayed event emission to settle. - Refactor the event uniqueness/order checking logic into a helper (
check_unique_events_in_order) returningResultfor reuse across retries.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a73be81 to
3bb1d61
Compare
Replace the brittle per-call-site `env.tick()` workaround in the cketh integration tests with an internal retry loop in `assert_has_unique_events_in_order` that ticks and re-fetches events up to 5 times before failing, so future changes to message execution don't require sprinkling more ticks throughout the test suite. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3bb1d61 to
81f7caa
Compare
assert_has_unique_events_in_order
mbjorkqvist
approved these changes
May 6, 2026
Contributor
mbjorkqvist
left a comment
There was a problem hiding this comment.
Thanks @gregorydemay, just one minor comment!
Address review feedback on PR #10099: distinguish the transient "missing event" failure (which the tick-and-retry loop is meant to recover from) from the structural "duplicate" and "out-of-order" failures, which can never become correct by ticking. Replace the String error with a CheckError enum and fail fast on the structural variants. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Upcoming message-execution changes (#10090) caused some events to not yet be visible at the moment cketh integration tests called
assert_has_unique_events_in_order, leading to test failures. Add a retry mechanism toassert_has_unique_events_in_orderto make the tests more robust.