Skip to content

(not for merging) Test to demonstrate failing chaining #32

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions tests/test_singleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,26 @@ def simple_task(*args):
tasks = [simple_task.apply_async(args=[i, i + 1, i + 2]) for i in range(5)]
assert len(set(tasks)) == len(tasks)

def test__chain_multiple_uniques__different_ids(
self, scoped_app, celery_session_worker
):
with scoped_app as app:

@celery_session_worker.app.task(base=Singleton)
def simple_task(*args):
print(args)
return args

celery_session_worker.reload()

async_result = (simple_task.si(1) | simple_task.s(2)).delay()
async_result2 = (simple_task.si(1) | simple_task.s(3)).delay()

time.sleep(0.1)

assert async_result.ready()
assert async_result2.ready()

def test__queue_duplicate_after_success__different_ids(
self, scoped_app, celery_session_worker
):
Expand Down