oslo.cache/oslo_cache/tests
Ben Nemec f4a25f6429 Fix memcache pool client in monkey-patched environments
First off, this is an ugly hack, but we're dealing with code that
essentially monkey-patches a monkey-patch. You reap what you sow.

Per the linked bug, our connection pool client explodes on python 3
with eventlet monkey-patching in force:

TypeError: object() takes no parameters

This is due to the way __new__ is overridden in the class. We need
to strip arguments from the call before they get to object(), which
doesn't accept args.

Unfortunately, when we're _not_ monkey-patched, adding the new
override implementation fails with:

TypeError: object.__new__(_MemcacheClient) is not safe,
use Client.__new__()

As such, we need different implementations depending on whether we
are monkey-patched or not. This change passes both with and without
monkey-patching and adds a unit test that exposes the bug.

Note that this is a temporary, backportable fix that will ultimately
be replaced by a switch to the pymemcache library which does not
have the threading.local problem being worked around here.

Change-Id: I039dffadeebd0ff4479b9c870c257772c43aba53
Partial-Bug: 1812935
2019-02-27 16:19:34 +00:00
..
functional etcd3 driver for oslo.cache 2017-05-26 10:55:25 -04:00
__init__.py Don't register backends on import 2015-07-08 19:38:17 -05:00
test_cache.py fix dogpile.cache issue due to the new usage of decorate in the lib 2019-02-26 19:45:22 +01:00
test_cache_backend_mongo.py Replaces uuid.uuid4 with uuidutils.generate_uuid() 2017-03-09 06:54:43 +00:00
test_connection_pool.py Fix memcache pool client in monkey-patched environments 2019-02-27 16:19:34 +00:00
test_dict_backend.py Implement get/set/delete multiple keys for dictionary backend 2015-08-24 21:30:14 -04:00