Repository navigation
FIX Count built nodes instead of timing the budget-exhaustion hierarchy test - #3609
Closed
Shivam Sharma (ShivamSharma43) wants to merge 1 commit into
Closed
Shivam Sharma (ShivamSharma43) wants to merge 1 commit into
Shivam Sharma (ShivamSharma43) wants to merge 1 commit into
Conversation
…hy test test_hierarchy_traversal_halts_immediately_on_budget_exhaustion asserted that build_scenario_hierarchy finished in under 50 ms, which fails on loaded CI runners (1.6-2.25 s) although the call takes about 8 ms. Spy on _map_hierarchy_node and assert only the one node the budget allows is built. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Roman Lutz (@romanlutz) Thanks for assigning #3608. This PR's workflows are waiting for approval to run (all five show |
Contributor
Author
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.
Description
Fixes #3608.
test_hierarchy_traversal_halts_immediately_on_budget_exhaustiontimedbuild_scenario_hierarchy(1,000 roots,max_nodes=1) and assertedelapsed < 0.05. The call takes about 8 ms, but on CI it intermittently measures 1.6–2.25 s and failsbuild_and_teston unrelated PRs. #3608 lists today's runs from several contributors.Changes:
ScenarioProgressReadModel._map_hierarchy_nodewithpatch.object(..., wraps=...)and asserts it's called exactly once: only the node the budget allows is built, and the other 999 roots are never mapped.truncatedisTrue, one root is in the projection, andoverall_counts.completed == 1000.No production code changes.
Tests and Documentation
mainin about 2 s, with no timing dependency.build_scenario_hierarchy(the earlyreturn Nonein_build_nodeand thebreakin the root loop). The test then fails withassert 1000 == 1.ruff check,ruff formatandty checkpass on the changed file.🤖 Generated with Claude Code