From a812537e4d5cf1883ba3191ed478fc25f2066329 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Tue, 20 Oct 2020 20:54:37 -0400 Subject: [PATCH] Handle port-less $MEMCACHE_SERVERS in MemCacheStore tests Devs may be running tests on a machine which provides $MEMCACHE_SERVERS without a trailing port. We should allow for this when checking if Memcache is working. --- actionpack/test/dispatch/session/mem_cache_store_test.rb | 2 +- activesupport/test/cache/stores/mem_cache_store_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/actionpack/test/dispatch/session/mem_cache_store_test.rb b/actionpack/test/dispatch/session/mem_cache_store_test.rb index ac685a7dca..417a8355bf 100644 --- a/actionpack/test/dispatch/session/mem_cache_store_test.rb +++ b/actionpack/test/dispatch/session/mem_cache_store_test.rb @@ -40,7 +40,7 @@ def call_reset_session require "dalli" servers = ENV["MEMCACHE_SERVERS"] || "localhost:11211" ss = Dalli::Client.new(servers).stats - raise Dalli::DalliError unless ss[servers] + raise Dalli::DalliError unless ss[servers] || ss[servers + ":11211"] def test_setting_and_getting_session_value with_test_route_set do diff --git a/activesupport/test/cache/stores/mem_cache_store_test.rb b/activesupport/test/cache/stores/mem_cache_store_test.rb index 23ad36ffb9..a85919ef07 100644 --- a/activesupport/test/cache/stores/mem_cache_store_test.rb +++ b/activesupport/test/cache/stores/mem_cache_store_test.rb @@ -27,7 +27,7 @@ class MemCacheStoreTest < ActiveSupport::TestCase begin servers = ENV["MEMCACHE_SERVERS"] || "localhost:11211" ss = Dalli::Client.new(servers).stats - raise Dalli::DalliError unless ss[servers] + raise Dalli::DalliError unless ss[servers] || ss[servers + ":11211"] MEMCACHE_UP = true rescue Dalli::DalliError