File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
activesupport/test/cache/stores Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,9 @@ class MemCacheStoreTest < ActiveSupport::TestCase
36
36
end
37
37
38
38
def lookup_store ( options = { } )
39
- ActiveSupport ::Cache . lookup_store ( *store , { namespace : @namespace } . merge ( options ) )
39
+ cache = ActiveSupport ::Cache . lookup_store ( *store , { namespace : @namespace } . merge ( options ) )
40
+ ( @_stores ||= [ ] ) << cache
41
+ cache
40
42
end
41
43
42
44
def setup
@@ -48,6 +50,15 @@ def setup
48
50
@cache . logger = ActiveSupport ::Logger . new ( File ::NULL )
49
51
end
50
52
53
+ def after_teardown
54
+ stores , @_stores = @_stores , [ ]
55
+ stores . each do |store |
56
+ # Eagerly closing Dalli connection avoid file descriptor exhaustion.
57
+ # Otherwise the test suite is flaky when ran repeatedly
58
+ store . instance_variable_get ( :@data ) . close
59
+ end
60
+ end
61
+
51
62
include CacheStoreBehavior
52
63
include CacheStoreVersionBehavior
53
64
include CacheStoreCoderBehavior
You can’t perform that action at this time.
0 commit comments