Skip to content

Commit 3383ca1

Browse files
committed
Speedup cache store pool timeout tests
1 parent 13afeb3 commit 3383ca1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

activesupport/test/cache/behaviors/connection_pool_behavior.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def test_connection_pool
77
threads = []
88

99
emulating_latency do
10-
cache = ActiveSupport::Cache.lookup_store(*store, { pool: { size: 2, timeout: 1 } }.merge(store_options))
10+
cache = ActiveSupport::Cache.lookup_store(*store, { pool: { size: 2, timeout: 0.1 } }.merge(store_options))
1111
cache.read("foo")
1212

1313
assert_nothing_raised do
@@ -35,7 +35,7 @@ def test_connection_pool_fetch
3535
results = []
3636

3737
emulating_latency do
38-
cache = ActiveSupport::Cache.lookup_store(*store, { pool: { size: 2, timeout: 1 } }.merge(store_options))
38+
cache = ActiveSupport::Cache.lookup_store(*store, { pool: { size: 2, timeout: 0.1 } }.merge(store_options))
3939
value = SecureRandom.alphanumeric
4040
base_key = "latency:#{SecureRandom.uuid}"
4141

activesupport/test/cache/stores/redis_cache_store_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class SlowRedis < Redis
1111
def get(key)
1212
if /latency/.match?(key)
13-
sleep 3
13+
sleep 0.2
1414
super
1515
else
1616
super

0 commit comments

Comments
 (0)