Repository navigation
fix(test): give result.metadata a real dict in 3 multimodal perf/scalability mocks (#16990) - #16995
Conversation
…ability mocks (#16990) processor.py:167's result.metadata["persisted"] = await self._store_result( result) (added for #15234) runs against a plain Mock() in these tests with no metadata= kwarg set. Mock, unlike MagicMock, has no __setitem__, so the write raised, process()'s except-block caught it, and result.success came back False -- failing test_multimodal_processor_performance, test_concurrent_processing_performance, and test_multimodal_processor_ scalability under the slow/integration/distributed/performance marker suite, which doesn't run on a normal PR's CI. Checked for other latent instances: the file's 4th Mock() (test_statistics_ tracking_performance) feeds processor._update_stats() directly, which never touches result.metadata, so it needs no change.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds a shared mock-result helper with writable metadata. Three multimodal benchmark tests use the helper so ChangesMultimodal benchmark fixture correction
Priority: ➖ Normal Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The fixture correction addresses the reported benchmark failures without changing production behavior. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
✅ SSOT Configuration Compliance: Passing🎉 No new hardcoded values of either class — Known backlog in |
…ze ratchet trip (#16990) The 3 metadata={} additions from the prior commit pushed this file from exactly 600 to 608 lines, tripping the file-size ratchet's ceiling (scripts/python_file_size_known_large.py explicitly forbids grandfathering a newly-over-limit file in: "Never add an entry to make a new file pass; split the file instead"). The 3 fixed Mock(...) construction sites were already near-identical (differing only in processing_time) -- extracted a module-level _mock_processed_result() helper, replacing each ~8-line block with a 1-line call. Removes duplication genuinely, not just to dodge the ratchet: 593 lines, comfortably under the ceiling.
Single-issue rationale: a narrow, incidental mock-fixture fix found while reviewing an unrelated PR (#16801); no other in-flight issue shares this scope (
system_benchmarks_performance_test.py's slow/integration/distributed/performance-marked tests).Thinking Path
Found while reviewing #16801 (the main → release promotion PR): its "Run slow / integration / distributed / performance tests" CI job was red on
system_benchmarks_performance_test.py. Root-caused toprocessor.py:167'sresult.metadata["persisted"] = await self._store_result(result)(added for #15234) running against a plainMock()in three tests' fixtures with nometadata=kwarg set —Mock(unlikeMagicMock) has no__setitem__, so the write raises,process()'s except-block catches it, and the result comes backsuccess=False. These tests carry markers (slow/integration/distributed/performance) that don't run on a normal PR's CI (ci.ymlexplicitly excludes them), so this has likely been broken since #15234 without being caught.What Changed
autobot-backend/system_benchmarks_performance_test.py: addedmetadata={}to the 3Mock(...)constructions feedingprocessor.process(...)intest_multimodal_processor_performance,test_concurrent_processing_performance, andtest_multimodal_processor_scalability.Mock(...)(test_statistics_tracking_performance) feedsprocessor._update_stats()directly, which never touchesresult.metadata, so it needed no change.Verification
All 14 tests in the file pass, including the 3 originally failing. Environment note: this dev box runs Python 3.10 (below the repo's declared 3.14 floor); this run used the CI-parity venv (
scripts/setup-ci-parity-env.sh, Python 3.14.6) so the result is a real signal, not a degraded one.One unrelated test in this same file,
test_system_startup_performance, fails deterministically on this specific machine due to a local HuggingFace model-cache/offline-fallback timing issue — confirmed unrelated to this fix (different test, no shared code path) and confirmed out of scope forci.yml's normal-PR gate (which excludes this whole marker class). Filed separately as #16994; deselected via-kfor this push's own pre-push verification, not silently skipped.Model Used
Claude Sonnet 5
Issue Link
Closes #16990
Checklist
<type>(scope): <description> (#issue)Summary by CodeRabbit