Skip to content
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

Test fails when using kombu 4.2.1 and celery 4.2.1 #20

Closed
softinio opened this issue Aug 30, 2018 · 5 comments
Closed

Test fails when using kombu 4.2.1 and celery 4.2.1 #20

softinio opened this issue Aug 30, 2018 · 5 comments

Comments

@softinio
Copy link

Just to verify this is compatible with latest version of Celery I cloned this repo, created a virtualenv running python 3.6.6 and ran your tests and got this error:

======================================================================
ERROR: test_task_retry (tenant_schemas_celery.tests.CeleryTasksTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/srahmanian/.pyenv/versions/dce/lib/python3.6/site-packages/tenant_schemas_celery/tests.py", line 104, in test_task_retry
    update_retry_task.apply_async(args=(self.dummy1.pk, 'updated-name'))
  File "/Users/srahmanian/.pyenv/versions/dce/lib/python3.6/site-packages/tenant_schemas_celery/task.py", line 27, in apply_async
    return super(TenantTask, self).apply_async(args, kwargs, *arg, **kw)
  File "/Users/srahmanian/.pyenv/versions/dce/lib/python3.6/site-packages/celery/app/task.py", line 519, in apply_async
    link=link, link_error=link_error, **options)
  File "/Users/srahmanian/.pyenv/versions/dce/lib/python3.6/site-packages/tenant_schemas_celery/task.py", line 37, in apply
    return super(TenantTask, self).apply(args, kwargs, *arg, **kw)
  File "/Users/srahmanian/.pyenv/versions/dce/lib/python3.6/site-packages/celery/app/task.py", line 736, in apply
    ret = tracer(task_id, args, kwargs, request)
  File "/Users/srahmanian/.pyenv/versions/dce/lib/python3.6/site-packages/celery/app/trace.py", line 396, in trace_task
    I, R, state, retval = on_error(task_request, exc, uuid)
  File "/Users/srahmanian/.pyenv/versions/dce/lib/python3.6/site-packages/celery/app/trace.py", line 382, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/Users/srahmanian/.pyenv/versions/dce/lib/python3.6/site-packages/tenant_schemas_celery/tests.py", line 36, in update_retry_task
    update_retry_task.retry(throw=False)
  File "/Users/srahmanian/.pyenv/versions/dce/lib/python3.6/site-packages/celery/app/task.py", line 677, in retry
    S.apply().get()
  File "/Users/srahmanian/.pyenv/versions/dce/lib/python3.6/site-packages/celery/result.py", line 989, in get
    assert_will_not_block()
  File "/Users/srahmanian/.pyenv/versions/dce/lib/python3.6/site-packages/celery/result.py", line 41, in assert_will_not_block
    raise RuntimeError(E_WOULDBLOCK)
RuntimeError: Never call result.get() within a task!
See http://docs.celeryq.org/en/latest/userguide/tasks.html#task-synchronous-subtasks


----------------------------------------------------------------------
Ran 3 tests in 0.951s

Any thoughts?

@maciej-gol
Copy link
Owner

Thanks, will look into this.

@maciej-gol
Copy link
Owner

This is an issue that arises from retrying tasks with eager celery. I will fix it soon, but it otherwise shouldn't affect your code. You could test it with async tasks and real queue.

@softinio
Copy link
Author

@maciej-gol let me know if I can help with getting this fixed. Happy to do a PR for you if you can give me some direction as I am not familiar with your code. Thanks

@maciej-gol
Copy link
Owner

maciej-gol commented Sep 11, 2018 via email

@maciej-gol
Copy link
Owner

Fixed on trunk. The tests were passing previously. Just newest celery discouraged using eager mode for tests so I had to rewrite the whole test machinery.

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

No branches or pull requests

2 participants