Skip to content

Commit 370ef3d

Browse files
authored
Use Dalli::Protocol::Binary instead of deprecated Dalli::Server
This commit addresses these failures with Dalli 3.0.1, which loses Dalli 2.x support. ```ruby $ bin/test test/cache/stores/mem_cache_store_test.rb -n test_fetch_read_failure_returns_nil Run options: -n test_fetch_read_failure_returns_nil --seed 2554 F Failure: OptimizedMemCacheStoreTest#test_fetch_read_failure_returns_nil [/home/yahonda/src/github.com/rails/rails/activesupport/test/cache/behaviors/failure_safety_behavior.rb:8]: Expected "bar" to be nil. bin/test test/cache/behaviors/failure_safety_behavior.rb:4 F Failure: MemCacheStoreTest#test_fetch_read_failure_returns_nil [/home/yahonda/src/github.com/rails/rails/activesupport/test/cache/behaviors/failure_safety_behavior.rb:8]: Expected "bar" to be nil. bin/test test/cache/behaviors/failure_safety_behavior.rb:4 Finished in 0.010229s, 195.5206 runs/s, 195.5206 assertions/s. 2 runs, 2 assertions, 2 failures, 0 errors, 0 skips $ ```
1 parent 2f8db2d commit 370ef3d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

activesupport/test/cache/stores/mem_cache_store_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,13 +288,13 @@ def emulating_latency
288288
end
289289

290290
def emulating_unavailability
291-
old_server = Dalli.send(:remove_const, :Server)
292-
Dalli.const_set(:Server, UnavailableDalliServer)
291+
old_server = Dalli::Protocol.send(:remove_const, :Binary)
292+
Dalli::Protocol.const_set(:Binary, UnavailableDalliServer)
293293

294294
yield ActiveSupport::Cache::MemCacheStore.new
295295
ensure
296-
Dalli.send(:remove_const, :Server)
297-
Dalli.const_set(:Server, old_server)
296+
Dalli::Protocol.send(:remove_const, :Binary)
297+
Dalli::Protocol.const_set(:Binary, old_server)
298298
end
299299

300300
def servers(cache = @cache)

0 commit comments

Comments
 (0)