fix(fastapi): restore retrying tests for Odoo 19#141
Merged
gonzalesedwin1123 merged 1 commit into19.0from Mar 30, 2026
Merged
Conversation
…53) Odoo 19's retrying() uses isinstance checks against PG_CONCURRENCY_EXCEPTIONS_TO_RETRY instead of pgcode-based checks. FakeConcurrentUpdateError inherited from OperationalError (a sibling of SerializationFailure), so isinstance returned False and the exception was re-raised instead of retried.
There was a problem hiding this comment.
Code Review
This pull request updates the demo_router.py to use SerializationFailure instead of OperationalError for handling concurrent updates and re-enables the retrying mechanism tests in test_fastapi.py by removing the skip decorators. I have no feedback to provide.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 19.0 #141 +/- ##
==========================================
- Coverage 72.25% 71.05% -1.20%
==========================================
Files 898 925 +27
Lines 52637 54723 +2086
==========================================
+ Hits 38032 38884 +852
- Misses 14605 15839 +1234
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
emjay0921
approved these changes
Mar 30, 2026
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.
Summary
FakeConcurrentUpdateErrorto inherit frompsycopg2.errors.SerializationFailureinstead ofOperationalErrorretrying()usesisinstancechecks againstPG_CONCURRENCY_EXCEPTIONS_TO_RETRYrather than pgcode-based checks, so the fake exception was not recognized as retryable@unittest.skipdecorators fromtest_retryingandtest_retrying_postCloses #53
Test plan
./scripts/test_single_module.sh fastapi— 19/19 tests pass (previously 17 + 2 skipped)