Skip to content

Commit c94bcaf

Browse files
committed
Attempt to reduce flakiness of scheduler_test
1 parent b61bbdf commit c94bcaf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

test/integration/instrumentation_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class InstrumentationTest < ActiveSupport::TestCase
5353
end
5454

5555
test "stopping a worker with claimed executions emits release_claimed events" do
56-
StoreResultJob.perform_later(42, pause: SolidQueue.shutdown_timeout + 100.second)
56+
StoreResultJob.perform_later(42, pause: SolidQueue.shutdown_timeout + 10.seconds)
5757
process = nil
5858

5959
events = subscribed(/release.*_claimed\.solid_queue/) do
@@ -88,7 +88,7 @@ class InstrumentationTest < ActiveSupport::TestCase
8888
end
8989

9090
test "starting and stopping a worker emits register_process and deregister_process events" do
91-
StoreResultJob.perform_later(42, pause: SolidQueue.shutdown_timeout + 100.second)
91+
StoreResultJob.perform_later(42, pause: SolidQueue.shutdown_timeout + 10.seconds)
9292
process = nil
9393

9494
events = subscribed(/(register|deregister)_process\.solid_queue/) do

test/unit/scheduler_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class SchedulerTest < ActiveSupport::TestCase
2424
end
2525

2626
schedulers.each(&:start)
27-
sleep 2
27+
wait_while_with_timeout(2.5.seconds) { SolidQueue::RecurringExecution.count != 2 }
2828
schedulers.each(&:stop)
2929

3030
assert_equal SolidQueue::Job.count, SolidQueue::RecurringExecution.count

0 commit comments

Comments
 (0)