Skip to content

Commit

Permalink
Handle port-less $MEMCACHE_SERVERS in MemCacheStore tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sambostock committed Oct 21, 2020
1 parent 0a608bd commit a812537
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion actionpack/test/dispatch/session/mem_cache_store_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion activesupport/test/cache/stores/mem_cache_store_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a812537

Please sign in to comment.