Repository navigation
test(enrichment): expire the delivery budget deterministically in the #24554 tests - #24566
Merged
Merged
Conversation
…24554 tests test_real_clock_budget_ratchet::test_no_new_tiny_real_clock_budgets went red on main (run 41757772369): the two budget tests set ENRICHMENT_DELIVERY_BUDGET_SECONDS=0.2 and raced a real clock. They now keep the production 300s budget and replace the route's budget wait with one that expires as soon as the callback is running (ratchet fix 1: the stub expires the budget), so the lease-held and re-arm assertions no longer depend on scheduler timing. No allowlist entry; production code unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
All reported issues were addressed across 1 file
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…running Luna r1 P2: an ignored running.wait(10) result could simulate the timeout before the callback ran. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
#24554 (merged at 052a59f) turned main red. The slow guardrail
tests/unit/test_real_clock_budget_ratchet.py::test_no_new_tiny_real_clock_budgetsfails in run 41757772369, job "Backend unit guardrails". Two new tests intests/unit/test_enrichment_route.pysetENRICHMENT_DELIVERY_BUDGET_SECONDS=0.2, which is a real-clock budget a loaded runner can race.What
asyncio.wait_forwith a stand-in that expires the budget as soon as the stubbed callback is running. This is ratchet fix 1: the stub expires the budget. The "lease still held" and "re-armed under a fresh wake" assertions therefore no longer depend on scheduler timing.Verification
bin/omi-heavy run -- backend/test.shwithBACKEND_UNIT_TEST_FILE_LIST=tests/unit/test_enrichment_route.py: 56 passed.BACKEND_PYTEST_MARK_EXPR=slowontests/unit/test_real_clock_budget_ratchet.py: 11 passed, includingtest_no_new_tiny_real_clock_budgets.Failure-Class: none
🤖 Generated with Claude Code