Skip to content

Commit 38a25d2

Browse files
committed
wip - set test msg depending on sidekiq ver
1 parent 25a4f64 commit 38a25d2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sentry-sidekiq/spec/spec_helper.rb

+7-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,13 @@ def execute_worker(processor, klass, **options)
259259
jid = options.delete(:jid) || "123123"
260260
timecop_delay = options.delete(:timecop_delay)
261261

262-
msg = Sidekiq.dump_json(created_at: Time.now.to_f, enqueued_at: Time.now.to_f, jid: jid, class: klass, args: [], **options)
262+
if WITH_SIDEKIQ_8
263+
current_time_ms = (Time.now.to_f * 1000).to_i
264+
msg = Sidekiq.dump_json(created_at: current_time_ms, enqueued_at: current_time_ms, jid: jid, class: klass, args: [], **options)
265+
else
266+
msg = Sidekiq.dump_json(created_at: Time.now.to_f, enqueued_at: Time.now.to_f, jid: jid, class: klass, args: [], **options)
267+
end
268+
263269
Timecop.freeze(timecop_delay) if timecop_delay
264270
work = Sidekiq::BasicFetch::UnitOfWork.new('queue:default', msg)
265271
process_work(processor, work)

0 commit comments

Comments
 (0)