Skip to content

ci(coverage): guard health-check skip against empty exception message#1474

Merged
sbryngelson merged 1 commit into
MFlowCode:masterfrom
sbryngelson:fix-health-empty-exc
May 31, 2026
Merged

ci(coverage): guard health-check skip against empty exception message#1474
sbryngelson merged 1 commit into
MFlowCode:masterfrom
sbryngelson:fix-health-empty-exc

Conversation

@sbryngelson

Copy link
Copy Markdown
Member

Follow-up to #1471. Addresses a Claude Code Review finding: in the skip handler,

str(exc).strip().splitlines()[-1]

raises IndexError if the exception's message is empty ("".splitlines()[]), and that secondary error is inside the except handler so it propagates and crashes the very graceful-skip path the change added. Low-probability (our cases raise MFCException with messages) but a real latent crash.

Fix: (str(exc).strip().splitlines() or ["(no message)"])[-1][:140].

Verified locally: still skips the 8 chemistry cases and reports healthy; the empty-ImportError() case now yields '(no message)' instead of raising.

If a skipped case raised an exception with an empty str() (e.g. ImportError() with no message), str(exc).strip().splitlines()[-1] indexed an empty list -> IndexError inside the except handler, which is uncaught and crashes the graceful-skip path. Fall back to '(no message)'. Caught by Claude Code Review on MFlowCode#1471.
Copilot AI review requested due to automatic review settings May 31, 2026 13:45
@sbryngelson sbryngelson merged commit 81ce63b into MFlowCode:master May 31, 2026
20 checks passed

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 encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@codecov

codecov Bot commented May 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.31%. Comparing base (574e53d) to head (a238ce5).
⚠️ Report is 13 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1474   +/-   ##
=======================================
  Coverage   61.31%   61.31%           
=======================================
  Files          72       72           
  Lines       19771    19771           
  Branches     2852     2852           
=======================================
  Hits        12123    12123           
  Misses       5699     5699           
  Partials     1949     1949           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants