summaryrefslogtreecommitdiff
path: root/tests/cache
diff options
context:
space:
mode:
authorEd Morley <emorley@mozilla.com>2016-09-02 09:33:59 +0100
committerTim Graham <timograham@gmail.com>2016-09-02 14:44:27 -0400
commitf02dbbe1ae02c3258fced7b7a75d35d7745cc02a (patch)
tree9a97b92b12e2e4a22fa098469e98b93f407f93d2 /tests/cache
parent3e935aec6d6c670b3e48425d60ec94fc96f5cdd6 (diff)
Fixed #11331 -- Stopped closing pylibmc connections after each request.
libmemcached manages its own connections, so isn't affected by refs #5133.
Diffstat (limited to 'tests/cache')
-rw-r--r--tests/cache/tests.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/cache/tests.py b/tests/cache/tests.py
index f9190ed55f..b8bce5e721 100644
--- a/tests/cache/tests.py
+++ b/tests/cache/tests.py
@@ -1156,6 +1156,10 @@ memcached_excluded_caches = {'cull', 'zero_cull'}
class BaseMemcachedTests(BaseCacheTests):
+ # By default it's assumed that the client doesn't clean up connections
+ # properly, in which case the backend must do so after each request.
+ should_disconnect_on_close = True
+
def test_location_multiple_servers(self):
locations = [
['server1.tld', 'server2:11211'],
@@ -1244,7 +1248,7 @@ class BaseMemcachedTests(BaseCacheTests):
# connection is closed when the request is complete.
with mock.patch.object(cache._lib.Client, 'disconnect_all', autospec=True) as mock_disconnect:
signals.request_finished.send(self.__class__)
- self.assertIs(mock_disconnect.called, True)
+ self.assertIs(mock_disconnect.called, self.should_disconnect_on_close)
@unittest.skipUnless(MemcachedCache_params, "MemcachedCache backend not configured")
@@ -1276,6 +1280,8 @@ class MemcachedCacheTests(BaseMemcachedTests, TestCase):
))
class PyLibMCCacheTests(BaseMemcachedTests, TestCase):
base_params = PyLibMCCache_params
+ # libmemcached manages its own connections.
+ should_disconnect_on_close = False
# By default, pylibmc/libmemcached don't verify keys client-side and so
# this test triggers a server-side bug that causes later tests to fail