-
Notifications
You must be signed in to change notification settings - Fork 213
Ensure triggering of callback in chord #397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -862,8 +862,8 @@ def test_on_chord_part_return_failure(self): | |
request.id = tid2 | ||
self.b.mark_as_failure(tid2, ValueError(), request=request) | ||
|
||
with pytest.raises(ChordCounter.DoesNotExist): | ||
ChordCounter.objects.get(group_id=gid) | ||
chord_counter.refresh_from_db() | ||
assert chord_counter.count == 1 | ||
Comment on lines
+865
to
+866
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is correct, we have a header of 2, 1 is done, the other fails. If this is the case, a ChordCounter object will remain in the db for every failed chord. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @AllexVeldman but if you have retry logic (on code or worker level) all task eventually are successful, but the callback is never triggered. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://docs.celeryq.dev/en/latest/reference/celery.result.html#celery.result.AsyncResult.ready would suggest So this test should call the path all the way to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, it took some time but I figured out why this change makes the test pass (which is still not correct). It's because the MagicMock used for the Add |
||
|
||
request.chord.delay.assert_not_called() | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.