Skip to content

test(orchestrator): pin record_success() breaker feed; note serializer=unknown is failure-only (LAB-6356) - #449

Merged
27Bslash6 merged 3 commits into
mainfrom
lab-6356-pin-record-success-breaker-feed
Oct 2, 2026
Merged

27Bslash6 merged 3 commits into
mainfrom
lab-6356-pin-record-success-breaker-feed

Conversation

@27Bslash6

Copy link
Copy Markdown
Contributor

Closes LAB-6356

What

  • test_record_success_emits_no_metric → test_record_success_feeds_breaker_and_emits_no_metric. It now spies on CircuitBreaker._on_success and asserts exactly one call per record_success(), on the orchestrator's own breaker.
  • docs/features/prometheus-metrics.md: the serializer label note now says only failure records (success="False") can carry unknown.

Why

The old final assertion (state == "CLOSED") held whether or not record_success() reached the breaker, because the breaker starts CLOSED and _on_success does nothing there. Feeding the breaker is now record_success()'s only job, and a HALF_OPEN probe slot is only released when its outcome reaches the breaker, so a silent no-op would go unnoticed. Verified: with record_success() stubbed to pass, the new test fails.

record_success() emits no metric, and every record_cache_operation call in wrapper.py passes serializer=. The only emitters without one are record_exception and record_failure, both success=False.

No production code change.

Checks

  • uv run pytest tests/unit tests/critical -m "not slow": 4047 passed, 25 skipped
  • uv run pytest --markdown-docs README.md docs/: 130 passed
  • ruff check / ruff format --check: clean

Docs: updated docs/features/prometheus-metrics.md; no other surface describes this behaviour.

…r=unknown is failure-only

The old assertion (state == CLOSED) held whether or not record_success()
reached the breaker, since the breaker starts CLOSED. Spy on _on_success
instead, so a no-op record_success() fails the test. Since record_success()
emits no metric, only failure records can carry serializer="unknown".
@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: cachekit-io/cachekit-py/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: c78ab615-a8db-4d02-9df3-a4e3129d07a4

📥 Commits

Reviewing files that changed from the base of the PR and between b9ad394 and 3184949.

📒 Files selected for processing (2)
  • docs/features/prometheus-metrics.md
  • tests/unit/test_operation_context_tracking.py
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@kodus-27b

kodus-27b Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the `@kody start-review` command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Providing Context (Files & MCPs)

Add these hints in your PR description (or a comment) to unlock deeper checks:

  • Ticket / Acceptance Criteria: `Refs: ABC-123` (Linear/Jira/Asana/ClickUp/Trello) or a direct ticket link.
  • Bugfix Validation: a Sentry/Datadog/Bugsnag event link (or paste the stack trace/error message).
  • Endpoint Risk: mention the route (e.g., `POST /api/payments`) or controller/action name.
  • Attach a repo file as context: use an explicit marker like `@file:docs/guide.mdx#L10-L50` (replace with your real path).
  • API Contract Docs: include `@file:openapi.yaml` or `@file:swagger.json` when changing routes/schemas.
  • Definition of Done / Standards: include `@file:DOD.md` or `@file:CONTRIBUTING.md` if your repo has them.
  • Design System Source of Truth: include `@file:ui/index.ts` (replace with your DS entrypoint path).
  • Feature Flags: include the flag key/name and `@file:flags.ts` / `@file:config.json` (and optionally the PostHog flag name).
  • Edge/CDN Rules: link the Cloudflare rule/zone or describe the intended redirect/header behavior.
  • Attach an MCP tool output: use `@mcp<provider|tool>` (replace with an installed MCP provider + tool, e.g., `@mcp<sentry|events.search>`).
Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

@codecov

codecov Bot commented Oct 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@27Bslash6
27Bslash6 merged commit a6f486f into main Oct 2, 2026
36 checks passed
@27Bslash6
27Bslash6 deleted the lab-6356-pin-record-success-breaker-feed branch October 2, 2026 18:56
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.

1 participant