sidekiq_status icon indicating copy to clipboard operation
sidekiq_status copied to clipboard

SidekiqStatus jobs enqueued with perform_at/perform_in raise an exception when they run

Open jakeonfire opened this issue 7 years ago • 2 comments

stack trace from Sidekiq:

SidekiqStatus::Container::StatusNotFound: 0bb902282a1ad80d35fb5919
sidekiq_status-1.2.0/lib/sidekiq_status/container.rb:149:in `load_data'
sidekiq_status-1.2.0/lib/sidekiq_status/container.rb:128:in `load'
sidekiq_status-1.2.0/lib/sidekiq_status/worker.rb:18:in `perform'

Is it related to this change?

Do not create (and display in sidekiq_status/web) status containers for the jobs scheduled to run in the future by the means of perform_at/perform_in (mhfs)

jakeonfire avatar Mar 10 '17 19:03 jakeonfire

Getting same error trying to run tests by invoking the jobs inline (for simplicity), so:

OneFineJob.new(args).perform

will fail because there is no value in Redis (I think). I can get around this by

Sidekiq::Testing.inline! do
  OneFineJob.perform_async(args)
end

But it seems strange that the a SidekiqStatus job would throw an error when explicitly processed inline, as opposed to just having features disabled.

Edit: arguably I should make this a separate issue, let me know.

niborg avatar Apr 04 '17 16:04 niborg

From the spec/worker_spec.rb I found an example that could work with the calling perform

    let(:worker) { SomeWorker.new }

    it "loads container using @jid and runs original perform" do
      expect(worker).to receive(:some_method).with(*args)
      jid = SomeWorker.perform_async(*args)
      worker.jid = jid.freeze
      worker.perform(*args)
    end

samuelvaneck avatar Dec 15 '21 11:12 samuelvaneck