Fix retryable task tests by correcting decorator composition and per-test retry counter setup - #9845
Draft
Archaeopteryx with Copilot wants to merge 2 commits into
Draft
Fix retryable task tests by correcting decorator composition and per-test retry counter setup#9845Archaeopteryx with Copilot wants to merge 2 commits into
Archaeopteryx with Copilot wants to merge 2 commits into
Conversation
✅ Deploy Preview for treeherder ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-authored-by: Archaeopteryx <216576+Archaeopteryx@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix decorator order and initialization in retryable task tests
Fix retryable task tests by correcting decorator composition and per-test retry counter setup
Sep 3, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9845 +/- ##
=======================================
Coverage 83.85% 83.85%
=======================================
Files 643 643
Lines 39269 39276 +7
Branches 3502 3502
=======================================
+ Hits 32929 32936 +7
Misses 5950 5950
Partials 390 390 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
test_retryable_task_throwsandtest_retryable_task_throws_retryregressed due to decorator composition that returned plain functions (losing.delay()), plus retry counter state initialized at module load. This updates test task construction so Celery wrapping remains outermost and retry counting is initialized per test instance.Decorator composition (Celery task integrity)
@count_retriesis applied to the raw function, with@retryable_task()outermost, so the exported object is still a Celery task and supports.delay().Retry counter isolation
thread_data.retry_countinitialization out of decorator definition time and into task factory functions used by each test.Counter semantics cleanup
count_retriesto increment from0by+1per invocation.*args/**kwargsand return the wrapped function result.Test task setup updates
create_throwing_task()andcreate_throwing_task_should_retry()factories.