Skip to content

Fix flaky stateful API check #6463

Merged
sudo-shashank merged 2 commits intomainfrom
shashank/flaky-stateful-check
Jan 22, 2026
Merged

Fix flaky stateful API check #6463
sudo-shashank merged 2 commits intomainfrom
shashank/flaky-stateful-check

Conversation

@sudo-shashank
Copy link
Copy Markdown
Contributor

@sudo-shashank sudo-shashank commented Jan 22, 2026

Summary of changes

Changes introduced in this pull request:

  • Increase confidence level to 1 for StateWaitMsg in stateful API test.
  • Log filter_spec and cid when logs are empty (i.e., !logs.is_empty() fails) to facilitate the investigation when it occurs again.

Reference issue to close (if applicable)

Closes #6462

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Summary by CodeRabbit

  • Tests
    • Improved test assertion capabilities with enhanced error messages providing clearer diagnostic information for debugging.
    • Refined test parameter handling and resource ownership semantics across test cases to maintain consistency and prevent unintended state changes.
    • Strengthened error diagnostics for filter-related operations with more informative reporting.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 22, 2026

Walkthrough

The PR fixes flaky eth_get_filter_logs stateful API tests by adjusting StateWaitMsg::request parameters (changing wait count from 0 to 1 and enabling confirmation), cloning filter_spec for proper ownership handling in EthNewFilter calls, and improving error diagnostics with anyhow::ensure!.

Changes

Cohort / File(s) Summary
Stateful API Test Fixes
src/tool/subcommands/api_cmd/stateful_tests.rs
Adjusted StateWaitMsg::request invocations from (message_cid, 0, tipset.epoch(), false) to (message_cid, 1, tipset.epoch(), true) to increase wait confirmation. Added filter_spec cloning in EthNewFilter::request calls to preserve ownership across awaits. Strengthened empty logs assertion with anyhow::ensure! including filter_spec and cid context.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

RPC

Suggested reviewers

  • LesnyRumcajs
  • akaladarshi
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix flaky stateful API check' is concise, clear, and directly reflects the main objective of the pull request to address intermittent test failures.
Linked Issues check ✅ Passed The pull request addresses both primary objectives from linked issue #6462: increasing StateWaitMsg confidence level to 1 and adding diagnostic logging when logs are empty.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the flaky stateful API check: adjusting StateWaitMsg parameters, improving error diagnostics, and ensuring proper filter_spec handling.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

@sudo-shashank sudo-shashank marked this pull request as ready for review January 22, 2026 09:13
@sudo-shashank sudo-shashank requested a review from a team as a code owner January 22, 2026 09:13
@sudo-shashank sudo-shashank requested review from LesnyRumcajs and akaladarshi and removed request for a team January 22, 2026 09:13
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.70%. Comparing base (9daeeb0) to head (967939b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

see 9 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9daeeb0...967939b. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sudo-shashank sudo-shashank added this pull request to the merge queue Jan 22, 2026
Merged via the queue into main with commit 4334bbc Jan 22, 2026
64 checks passed
@sudo-shashank sudo-shashank deleted the shashank/flaky-stateful-check branch January 22, 2026 10:30
@coderabbitai coderabbitai Bot mentioned this pull request Jan 28, 2026
6 tasks
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.

Stateful API checks fails periodically

2 participants