Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a focused unit-test regression to ensure Celery’s Request.on_success() callback path correctly propagates a MemoryError (via Request.on_failure() raising MemoryError("Process got: ...")) when acks_late is enabled, aligning with the expected pool callback contract referenced in #10462.
Changes:
- Add a unit regression test covering
Request.on_success()→Request.on_failure()behavior when the traced exception isMemoryErrorunderacks_late.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10482 +/- ##
=======================================
Coverage 88.69% 88.69%
=======================================
Files 153 153
Lines 19859 19859
Branches 2313 2313
=======================================
Hits 17613 17613
Misses 1948 1948
Partials 298 298
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Description
Add focused regression coverage for the Celery request callback path when an
acks_latetask fails withMemoryError.The pool reports the traced task failure through
Request.on_success(), which delegates toRequest.on_failure(). Celery intentionally raises a newMemoryErrorfrom that path, but Billiard previously caught and swallowed it. celery/billiard#451 corrected the complementary pool callback behavior soMemoryErrornow propagates.This test constructs the traced
MemoryError, passes it through the optimized request class'son_success()callback, and verifies that the realon_failure()handler raises the transformedProcess got: out of memoryexception. It covers Celery's side of the callback contract without duplicating Billiard'sApplyResultregression.Related to #10462.
Validation
python -m pytest -q t/unit/worker/test_request.py: 142 passed, 3 warnings.MemoryErrorand callback-path tests: 3 passed.python -m compileall -q t/unit/worker/test_request.py: passed.t/unit/worker/test_request.py.git diff --check: passed.Risk
Low. This is a test-only change and does not alter Celery runtime behavior or dependency constraints.
AI disclosure
This PR includes AI-assisted code understanding to speed up the process; the test was updated and reviewed manually with AI assistance.