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

Remove assertion that jobs are never nested in the ActiveJob extension #369

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jeremiahrose
Copy link

@jeremiahrose jeremiahrose commented Aug 3, 2022

This assertion is untrue in the Rails ActiveJob tests, and has been overridden in the Rails repo, so it never runs anyway.

@ZimbiX indicated that we should have some discussion about this to figure out the best approach, so I'm mostly just submitting this PR to stimulate the discussion.

Closes #329

This assertion is untrue in the Rails ActiveJob tests, and has been overridden in the Rails repo, so it never runs anyway.
# make sense to run a worker inside of a job, but even so, assert that
# nothing absurd is going on.
Que.assert NilClass, Thread.current[:que_current_job]

Copy link
Contributor

Choose a reason for hiding this comment

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

This method has only been overridden by an ActiveJob test support helper specifically to prevent this assertion from making the Rails test suite fail. This assertion still runs in production on Rails.

It's possible that removing the assertion is ok, but I would like to have a better grasp as to why it was added in the first place before we do. If there is some logic downstream from this point that depends on the fact that jobs are not nested, then removing the assertion may make the Rails test suite pass but could break que.

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.

Que 1.0 failing in Active Job tests
2 participants