-
Notifications
You must be signed in to change notification settings - Fork 182
Fix test for eth_newFilter creation #6104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdjusts stateful test logic to compare expected failure messages case-insensitively and updates the eth_newFilter limit test by removing its ignore attribute while retaining the failure expectation. No public API signatures changed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/tool/subcommands/api_cmd/stateful_tests.rs (1)
148-151: Reduce allocations and match across error chain for robustness.Precompute lowercase once and check all error causes; avoids multiple allocations and improves resilience if the message is wrapped.
- let err_str = format!("{e:#}"); - if err_str - .to_lowercase() - .contains(&expected_msg.to_lowercase()) + let expected = expected_msg.to_lowercase(); + let err_lc = format!("{e:#}").to_lowercase(); + let contains_expected = err_lc.contains(&expected) + || e.chain().any(|cause| cause.to_string().to_lowercase().contains(&expected)); + if contains_expected {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/tool/subcommands/api_cmd/stateful_tests.rs(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: tests-release
- GitHub Check: tests
- GitHub Check: Build forest binaries on Linux AMD64
🔇 Additional comments (1)
src/tool/subcommands/api_cmd/stateful_tests.rs (1)
630-630: Verify exact server error text to avoid brittle matching. Test expects "maximum number of filters registered" (src/tool/subcommands/api_cmd/stateful_tests.rs:630). Repository search did not locate that string in server code — either shorten to a stable fragment like "maximum number of filters" or run the server and update the test to match the actual emitted message.
Summary of changes
Changes introduced in this pull request:
create_eth_new_filter_limit_testReference issue to close (if applicable)
Closes #5915
Other information and links
Change checklist
Summary by CodeRabbit