Skip to content

Commit 704256e

Browse files
authored
Merge pull request rails#49030 from fatkodima/optimize-ar-tests
Speedup activerecord tests
2 parents 90bdbe0 + df12ca0 commit 704256e

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

activerecord/test/cases/query_cache_test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,8 @@ def test_query_caching_is_local_to_the_current_thread
584584
Thread.new {
585585
assert_not ActiveRecord::Base.connection_pool.query_cache_enabled
586586
assert_not ActiveRecord::Base.connection.query_cache_enabled
587+
588+
ActiveRecord::Base.connection_handler.clear_active_connections!(:all)
587589
}.join
588590
}.call({})
589591
end

activerecord/test/support/connection.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ def self.test_configuration_hashes
2121
def self.connect
2222
ActiveRecord.async_query_executor = :global_thread_pool
2323
puts "Using #{connection_name}"
24-
ActiveRecord::Base.logger = ActiveSupport::Logger.new("debug.log", 1, 100 * 1024 * 1024)
24+
25+
if ENV["CI"]
26+
ActiveRecord::Base.logger = nil
27+
else
28+
ActiveRecord::Base.logger = ActiveSupport::Logger.new("debug.log", 1, 100.megabytes)
29+
end
30+
2531
ActiveRecord::Base.configurations = test_configuration_hashes
2632
ActiveRecord::Base.establish_connection :arunit
2733
ARUnit2Model.establish_connection :arunit2

0 commit comments

Comments
 (0)