Repository navigation
fix(benchmarks): isolate router benchmark imports - #14745
Conversation
Keep benchmark collection from occupying the top-level common module used by component test packages. Preserve direct script invocation and cover both import orders in isolated subprocesses. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Signed-off-by: jthomson04 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review. WalkthroughThe router priority benchmark now supports package and standalone execution. Tests configure an isolated benchmark environment and validate imports with a preloaded unrelated ChangesRouter benchmark import compatibility
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The import-isolation change retains both package and standalone execution paths, with targeted subprocess and CLI coverage. No merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description provides detailed scope, implementation details, affected errors, and validation results. However, it omits the required Related Issues section and does not identify where the reviewer should start.
Comment |
Signed-off-by: jthomson04 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
|
/ok to test 37a3de7 |
Summary
Fix the pytest import collision introduced by #14165. Collecting the router benchmark loaded
benchmarks/router/common.pyas the top-levelcommonmodule, which prevented component tests from importingcommon.backendandcommon.utils.benchmarks/routerfrom the test setup'ssys.path; retain the parent path required byprefix_data_generator.benchmarks/router/common.pyand import both tested helpers throughbenchmarks.router.common. Pytest no longer imports the CLI script.__package__conditional is needed.The same
No module named 'common.backend'; 'common' is not a packageerror appears in both:This change is limited to benchmark import isolation. Trace-hint behavior and CI configuration are unchanged.
Validation
Checked the revised patch in the local
dynamo:devcontainer with Python 3.12.3, the worktree mounted at/workspace, and source paths for components, Python bindings, and benchmarks onPYTHONPATH.python3 -m pytest -c pyproject.toml benchmarks/router/tests/test_common.py components/src/dynamo/common/backend/tests components/src/dynamo/common/utils/tests -n 0 -q --tb=short --continue-on-collection-errors --junitxml=..., then repeated with both component paths before the benchmark path. Each run completed with 3 passed, 6 skipped, 41 errors, confirmed in JUnit. The three benchmark tests passed in both orders; neither log contained thecommoncollision.AicPerfConfiganddynamo._core.backend. These runs are not a passing component-suite result; the affected suites still require validation in the CI image.python3 real_data_priority_benchmark.py --help: passed withPYTHONPATH=/workspace/benchmarksandMPLBACKEND=Agg.pre-commit run --files benchmarks/router/common.py benchmarks/router/real_data_priority_benchmark.py benchmarks/router/tests/conftest.py benchmarks/router/tests/test_common.py: passed.git diff --check: passed.