que-rb/que

Que 1.0 failing in Active Job tests

skipkayhil opened this issue · 1 comments

See failing tests here: https://buildkite.com/rails/rails/builds/84165#63b89f96-f556-468a-a2a9-e14019d5c179

I believe the issue boils down to this assumption in the Que::ActiveJob::WrapperExtensions that the worker won't ever nest:

# There's no reason this logic should ever nest, because it wouldn't
# 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]

This makes sense in environments with real workers, but this doesn't hold true with inline/run_synchronously. In Active Job tests that include retry_on, the retried job will call this run method before the previous one has returned.

Yikes, thanks for the heads up about breaking Rails' tests! We'll look into it