Skip to content

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.
@jeremiahrose jeremiahrose self-assigned this Aug 3, 2022
# 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