Skip to content

Commit

Permalink
Further improve tests related to bulk scheduling of jobs (#5171)
Browse files Browse the repository at this point in the history
* Use realistic values in scheduling tests

* Add one more failing test case

* Add failing test for regular push

* Remove the new tests as they expect too much
  • Loading branch information
adamniedzielski authored Feb 5, 2022
1 parent 6bfcf58 commit bc7389d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/test_scheduling.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def to_f; 42.0 end
assert_equal 3, ss.size
assert_equal qs+1, q.size

assert Sidekiq::Client.push_bulk('class' => SomeScheduledWorker, 'args' => [['mike'], ['mike']], 'at' => 600)
assert Sidekiq::Client.push_bulk('class' => SomeScheduledWorker, 'args' => [['mike'], ['mike']], 'at' => Time.now.to_f + 100)
assert_equal 5, ss.size

assert SomeScheduledWorker.perform_in(TimeDuck.new, 'samwise')
Expand All @@ -59,11 +59,10 @@ def to_f; 42.0 end
ss = Sidekiq::ScheduledSet.new
ss.clear

assert Sidekiq::Client.push_bulk('class' => SomeScheduledWorker, 'args' => [['mike'], ['mike']], 'at' => 600)
assert Sidekiq::Client.push_bulk('class' => SomeScheduledWorker, 'args' => [['mike'], ['mike']], 'at' => Time.now.to_f + 100)
job = ss.first
assert job['created_at']
refute job['enqueued_at']
end
end

end

0 comments on commit bc7389d

Please sign in to comment.