Conversation
Code Review Agent Run #ecf374Actionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #44437 +/- ##
===========================================
+ Coverage 66.29% 80.64% +14.35%
===========================================
Files 2942 2942
Lines 175692 175692
Branches 40788 40788
===========================================
+ Hits 116467 141679 +25212
+ Misses 56770 31353 -25417
- Partials 2455 2660 +205
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
The only red check is Host-port collision on the shared runner, unrelated to this diff (test-only change; the same job is green on other PRs running today). Would a maintainer mind re-running that job, or I can push an empty commit if that's the preferred trigger — happy either way. |
Summary
Fixes the six master-red tests in
tests/unit_tests/commands/test_base_restore_version_command.py(#44436) sounit-tests-requiredstops reddening every PR built against master's tip.The two failing drivers feed
run()a bareMagicMock()entity. Since #44015,_do_restore()issues a real locking re-read (populate_existing().with_for_update()) beforeresolve_version, and the mock's auto-createdidcannot bind into that query (sqlite3.ProgrammingError). The@transaction(catches=(SQLAlchemyError, LookupError))wrapper translates the binding error intofailed_exc, so the patchedresolve_version/restore_versionseams are never reached — producing exactly the six reported failures (wrong__cause__, and the "passes through untranslated" driver seeing a translated error).Fix is test-side, per the issue:
_validate_contextnow gives the mock entity a real integeridand stubssuperset.commands.version_restore.dbwith a self-returning query chain whoseone_or_none()hands the entity back — the same wiringtest_restore_version_concurrency.pyalready uses for the lock itself.validate()-only tests are unaffected; the row lock in_do_restore()is untouched.Test plan
6 failed, 6 passed)12 passedfor the full filetest_restore_version_concurrency.py+tests/unit_tests/versioning=291 passedruff check+ruff format --checkcleanCloses #44436