From bee764965e80b0f4f0a15c31b340f245779a7d89 Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Mon, 29 Jan 2018 20:37:48 +0900 Subject: Suppress expected exceptions by `report_on_exception` = `false` This suppresses `Timeout::Error` exceptions. Ref: https://travis-ci.org/rails/rails/jobs/334622442#L1089-L1110 --- activesupport/test/cache/behaviors/connection_pool_behavior.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activesupport') diff --git a/activesupport/test/cache/behaviors/connection_pool_behavior.rb b/activesupport/test/cache/behaviors/connection_pool_behavior.rb index 500d51a134..0d46f88552 100644 --- a/activesupport/test/cache/behaviors/connection_pool_behavior.rb +++ b/activesupport/test/cache/behaviors/connection_pool_behavior.rb @@ -2,6 +2,8 @@ module ConnectionPoolBehavior def test_connection_pool + Thread.report_on_exception, original_report_on_exception = false, Thread.report_on_exception if Thread.respond_to?(:report_on_exception) + emulating_latency do begin cache = ActiveSupport::Cache.lookup_store(store, pool_size: 2, pool_timeout: 1) @@ -24,6 +26,8 @@ module ConnectionPoolBehavior threads.each(&:kill) end end + ensure + Thread.report_on_exception = original_report_on_exception if Thread.respond_to?(:report_on_exception) end def test_no_connection_pool -- cgit v1.2.3