From 52e2a86c3c43aa0a1bade725f9691aa912251e07 Mon Sep 17 00:00:00 2001 From: Pedro Mendes Date: Tue, 28 Oct 2025 14:41:00 -0300 Subject: [PATCH 1/3] Ensure dispatcher is stopped after assertion --- test/unit/dispatcher_test.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/unit/dispatcher_test.rb b/test/unit/dispatcher_test.rb index 9aa2196e..89d87c1a 100644 --- a/test/unit/dispatcher_test.rb +++ b/test/unit/dispatcher_test.rb @@ -107,6 +107,8 @@ class DispatcherTest < ActiveSupport::TestCase assert_equal 0, SolidQueue::ScheduledExecution.count assert_equal 3, SolidQueue::ReadyExecution.count + ensure + dispatcher.stop end test "sleeps `polling_interval` between polls if there are no un-dispatched jobs" do @@ -117,6 +119,8 @@ class DispatcherTest < ActiveSupport::TestCase dispatcher.start wait_while_with_timeout(1.second) { !SolidQueue::ScheduledExecution.exists? } + ensure + dispatcher.stop end private From 86d323b1c47ec9c71cc1e98ef992c049c3f65335 Mon Sep 17 00:00:00 2001 From: Pedro Mendes Date: Tue, 28 Oct 2025 14:41:58 -0300 Subject: [PATCH 2/3] Increase `retention-days` for failed CI logs --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ddc47f50..7485e17e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -79,4 +79,4 @@ jobs: path: | test/dummy/log/test.log if-no-files-found: ignore - retention-days: 7 + retention-days: 30 From dc17abc142564976b0b43233b752ef3195bdd6bd Mon Sep 17 00:00:00 2001 From: Pedro Mendes Date: Tue, 28 Oct 2025 14:42:56 -0300 Subject: [PATCH 3/3] Reducing flakiness of `test/integration/concurrency_controls_test.rb` --- test/integration/concurrency_controls_test.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/integration/concurrency_controls_test.rb b/test/integration/concurrency_controls_test.rb index 178c796d..b3be95c5 100644 --- a/test/integration/concurrency_controls_test.rb +++ b/test/integration/concurrency_controls_test.rb @@ -36,14 +36,16 @@ class ConcurrencyControlsTest < ActiveSupport::TestCase end test "schedule several conflicting jobs over the same record sequentially" do - UpdateResultJob.set(wait: 0.23.seconds).perform_later(@result, name: "000", pause: 0.1.seconds) + # Writes to @result at 0.4s + UpdateResultJob.set(wait: 0.2.seconds).perform_later(@result, name: "000", pause: 0.2.seconds) ("A".."F").each_with_index do |name, i| - NonOverlappingUpdateResultJob.set(wait: (0.2 + i * 0.01).seconds).perform_later(@result, name: name, pause: 0.3.seconds) + # "A" is enqueued at 0.2s and writes to @result at 0.6s, the write at 0.4s gets overwritten + NonOverlappingUpdateResultJob.set(wait: (0.2 + i * 0.1).seconds).perform_later(@result, name: name, pause: 0.4.seconds) end ("G".."K").each_with_index do |name, i| - NonOverlappingUpdateResultJob.set(wait: (0.3 + i * 0.01).seconds).perform_later(@result, name: name) + NonOverlappingUpdateResultJob.set(wait: (1 + i * 0.1).seconds).perform_later(@result, name: name) end wait_for_jobs_to_finish_for(5.seconds)