Repository navigation
test(orchestrator): pin record_success() breaker feed; note serializer=unknown is failure-only (LAB-6356) - #449
Conversation
…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".
|
Warning Review limit reachedYou'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. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configurationConfiguration used: Repository: cachekit-io/cachekit-py/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
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. Comment |
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Providing Context (Files & MCPs)Add these hints in your PR description (or a comment) to unlock deeper checks:
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Closes LAB-6356
What
test_record_success_emits_no_metric→test_record_success_feeds_breaker_and_emits_no_metric. It now spies onCircuitBreaker._on_successand asserts exactly one call perrecord_success(), on the orchestrator's own breaker.docs/features/prometheus-metrics.md: theserializerlabel note now says only failure records (success="False") can carryunknown.Why
The old final assertion (
state == "CLOSED") held whether or notrecord_success()reached the breaker, because the breaker starts CLOSED and_on_successdoes nothing there. Feeding the breaker is nowrecord_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: withrecord_success()stubbed topass, the new test fails.record_success()emits no metric, and everyrecord_cache_operationcall inwrapper.pypassesserializer=. The only emitters without one arerecord_exceptionandrecord_failure, bothsuccess=False.No production code change.
Checks
uv run pytest tests/unit tests/critical -m "not slow": 4047 passed, 25 skippeduv run pytest --markdown-docs README.md docs/: 130 passedruff check/ruff format --check: cleanDocs: updated
docs/features/prometheus-metrics.md; no other surface describes this behaviour.