File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,8 @@ class ConcurrencyControlsTest < ActiveSupport::TestCase
197197
198198 test "discard jobs when concurrency limit is reached with on_conflict: :discard" do
199199 job1 = DiscardableUpdateResultJob . perform_later ( @result , name : "1" , pause : 3 )
200+ sleep ( 0.1 )
201+
200202 # should be discarded due to concurrency limit
201203 job2 = DiscardableUpdateResultJob . perform_later ( @result , name : "2" )
202204 # should also be discarded
@@ -219,8 +221,9 @@ class ConcurrencyControlsTest < ActiveSupport::TestCase
219221
220222 test "discard on conflict across different concurrency keys" do
221223 another_result = JobResult . create! ( queue_name : "default" , status : "" )
222- DiscardableUpdateResultJob . perform_later ( @result , name : "1" , pause : 0.2 )
223- DiscardableUpdateResultJob . perform_later ( another_result , name : "2" , pause : 0.2 )
224+ DiscardableUpdateResultJob . perform_later ( @result , name : "1" , pause : 2 )
225+ DiscardableUpdateResultJob . perform_later ( another_result , name : "2" , pause : 2 )
226+ sleep ( 0.1 )
224227 DiscardableUpdateResultJob . perform_later ( @result , name : "3" ) # Should be discarded
225228 DiscardableUpdateResultJob . perform_later ( another_result , name : "4" ) # Should be discarded
226229
You can’t perform that action at this time.
0 commit comments