Skip to content

fix(fastapi): restore retrying tests for Odoo 19#141

Merged
gonzalesedwin1123 merged 1 commit into19.0from
fix/fastapi-retrying-tests-53
Mar 30, 2026
Merged

fix(fastapi): restore retrying tests for Odoo 19#141
gonzalesedwin1123 merged 1 commit into19.0from
fix/fastapi-retrying-tests-53

Conversation

@gonzalesedwin1123
Copy link
Copy Markdown
Member

Summary

  • Fix FakeConcurrentUpdateError to inherit from psycopg2.errors.SerializationFailure instead of OperationalError
  • Odoo 19's retrying() uses isinstance checks against PG_CONCURRENCY_EXCEPTIONS_TO_RETRY rather than pgcode-based checks, so the fake exception was not recognized as retryable
  • Remove @unittest.skip decorators from test_retrying and test_retrying_post

Closes #53

Test plan

  • ./scripts/test_single_module.sh fastapi — 19/19 tests pass (previously 17 + 2 skipped)
  • Linter passes on changed files

…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.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown

codecov Bot commented Mar 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.05%. Comparing base (b99d82c) to head (c5b3167).
⚠️ Report is 17 commits behind head on 19.0.

Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
fastapi 86.92% <100.00%> (+2.71%) ⬆️
spp_api_v2 79.96% <ø> (ø)
spp_api_v2_change_request 66.85% <ø> (ø)
spp_api_v2_cycles 71.12% <ø> (ø)
spp_api_v2_data 64.41% <ø> (ø)
spp_api_v2_entitlements 70.19% <ø> (ø)
spp_api_v2_gis 71.52% <ø> (ø)
spp_api_v2_products 66.27% <ø> (ø)
spp_api_v2_service_points 70.94% <ø> (ø)
spp_api_v2_simulation 71.12% <ø> (ø)
spp_api_v2_vocabulary 57.26% <ø> (ø)
spp_base_common 90.26% <ø> (ø)
spp_dci_client_dr 55.87% <ø> (ø)
spp_dci_client_ibr 60.17% <ø> (ø)
spp_dci_server 35.68% <ø> (?)
spp_mis_demo_v2 69.73% <ø> (-0.09%) ⬇️
spp_programs 62.23% <ø> (ø)
spp_security 66.66% <ø> (ø)
spp_starter_social_registry 0.00% <ø> (ø)
spp_starter_sp_mis 81.25% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
fastapi/routers/demo_router.py 100.00% <100.00%> (+24.52%) ⬆️

... and 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gonzalesedwin1123 gonzalesedwin1123 merged commit f738582 into 19.0 Mar 30, 2026
35 checks passed
@gonzalesedwin1123 gonzalesedwin1123 deleted the fix/fastapi-retrying-tests-53 branch March 30, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Odoo 19: Restore FastAPI retrying HttpCase tests

2 participants