You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
moduleGoodJob# Thread-local attributes for passing values from Instrumentation.# (Cannot use ActiveSupport::CurrentAttributes because ActiveJob resets it)moduleCurrentThread# ...
This pointed me to the following issue at rails: rails/rails#49227
It confirms that "CurrentAttributes are cleared when a job gets executed inline in test".
This means inline tests of ActiveJobs are broken.
Side effects on other gems, like GoodJob have yet to be determined. I am checking this now...
The text was updated successfully, but these errors were encountered:
I have ActsAsTenant version 1.0.1 running in my Rails 7.0 application.
I just wanted to switch from Sidekiq to GoodJob.
For this, I also changed all my jobs from Sidekiq Workers to ActiveJob jobs.
I realized that some tests started to fail in an odd way.
Specifically,
current_tenant
was suddenly not set anymore.I suspect there are multiple issues going on
One has been mentioned in #328. I think
ActsAsTenant.with_tenant
should be used hereThe new issue I want to report here is that
ActiveJob
andActiveSupport::CurrentAttributes
have undesired side effects.I learned at https://github.com/bensheldon/good_job/blob/ab5129030067f1c97253d90b3d1ef96da25ff733/lib/good_job/current_thread.rb#L8 the following:
This pointed me to the following issue at rails: rails/rails#49227
It confirms that "
CurrentAttributes
are cleared when a job gets executed inline in test".This means inline tests of ActiveJobs are broken.
Side effects on other gems, like GoodJob have yet to be determined. I am checking this now...
The text was updated successfully, but these errors were encountered: