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

During testing do not postpone execution of the tasks #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ticosax
Copy link
Contributor

@ticosax ticosax commented Nov 7, 2014

No description provided.

@nickbruun
Copy link
Contributor

We should probably have test cases verifying that this works as expected depending on the configuration of ALWAYS_EAGER. @ticosax, will you add those?

@ticosax
Copy link
Contributor Author

ticosax commented Nov 10, 2014

sure

Should returns immediately
@ticosax
Copy link
Contributor Author

ticosax commented Nov 11, 2014

@nickbruun I added the test.



class EagerTestCase(TestCase):

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get some docstrings on this for good meassure.

@ticosax
Copy link
Contributor Author

ticosax commented Nov 11, 2014

ok done. I will squash all commits once you agree.

@nickbruun
Copy link
Contributor

Come to think of it, this would defeat the purpose of django_atomic_celery and give unexpectedly different behavior when using and when not using CELERY_ALWAYS_EAGER. Instead, tasks should be executed immediately rather than scheduled when the outermost transaction block is reached if CELERY_ALWAYS_EAGER is set, if testing (which is usually the case whereCELERY_ALWAYS_EAGERis employed) is to be deterministic.

@ticosax
Copy link
Contributor Author

ticosax commented Nov 18, 2014

I'm not sure I understand your point.
you wrote:

Instead, tasks should be executed immediately rather than scheduled when the outermost transaction block is reached if CELERY_ALWAYS_EAGER is set

I agree with you and it was my intent; the test is proving it.
Am I missing something ?

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

Successfully merging this pull request may close these issues.

2 participants