From bbf32eeab14b6e317bfab55e19231dd982398d91 Mon Sep 17 00:00:00 2001 From: Aidan Haran Date: Mon, 11 May 2020 17:24:42 +0100 Subject: [PATCH 1/2] Coerce reaper test using fork --- test/cases/coerced_tests.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/cases/coerced_tests.rb b/test/cases/coerced_tests.rb index 96feb1556..6ee893212 100644 --- a/test/cases/coerced_tests.rb +++ b/test/cases/coerced_tests.rb @@ -1483,3 +1483,15 @@ def test_has_primary_key_coerced original_test_has_primary_key end end + + + + +module ActiveRecord + module ConnectionAdapters + class ReaperTest < ActiveRecord::TestCase + # Coerce can be removed if Rails version > 6.0.3 + coerce_tests! :test_connection_pool_starts_reaper_in_fork + end + end +end From 2f908c433332d02bf778a5dec0d0768f46d37c02 Mon Sep 17 00:00:00 2001 From: Aidan Haran Date: Tue, 12 May 2020 11:08:18 +0100 Subject: [PATCH 2/2] Coerce test only if fork isn't supported --- test/cases/coerced_tests.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cases/coerced_tests.rb b/test/cases/coerced_tests.rb index 6ee893212..5833018f4 100644 --- a/test/cases/coerced_tests.rb +++ b/test/cases/coerced_tests.rb @@ -1491,7 +1491,7 @@ module ActiveRecord module ConnectionAdapters class ReaperTest < ActiveRecord::TestCase # Coerce can be removed if Rails version > 6.0.3 - coerce_tests! :test_connection_pool_starts_reaper_in_fork + coerce_tests! :test_connection_pool_starts_reaper_in_fork unless Process.respond_to?(:fork) end end end