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

Que 1.0 failing in Active Job tests #329

Open
skipkayhil opened this issue Jan 25, 2022 · 1 comment · May be fixed by #369
Open

Que 1.0 failing in Active Job tests #329

skipkayhil opened this issue Jan 25, 2022 · 1 comment · May be fixed by #369
Assignees

Comments

@skipkayhil
Copy link

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.

skipkayhil added a commit to skipkayhil/rails that referenced this issue Jan 25, 2022
Fixing the synchronous setting uncovered some more errors with Que 1.0:
exception tests with retry_on started failing due to an assertion in
Que's Active Job integration that running jobs won't nest. However, this
is not the case when running retriable jobs synchronously.

This change overrides Que's Active Job wrapper to not make this
assertion.

I also opened an issue in the que repo: que-rb/que#329
@ZimbiX
Copy link
Member

ZimbiX commented Jan 25, 2022

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

public-rant pushed a commit to opensource-rant/rails that referenced this issue Feb 17, 2022
Fixing the synchronous setting uncovered some more errors with Que 1.0:
exception tests with retry_on started failing due to an assertion in
Que's Active Job integration that running jobs won't nest. However, this
is not the case when running retriable jobs synchronously.

This change overrides Que's Active Job wrapper to not make this
assertion.

I also opened an issue in the que repo: que-rb/que#329
@jeremiahrose jeremiahrose self-assigned this Aug 1, 2022
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 a pull request may close this issue.

3 participants