From a35e3626c5bd781601904ee93ff062711246f418e7643f9a3e8edc21ebef70c4 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sun, 18 Feb 2018 17:35:07 +0000 Subject: [PATCH] - add dogpile-threading.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dogpile.cache?expand=0&rev=30 --- dogpile-threading.patch | 40 ++++++++++++++++++++++++++++++++++++ python-dogpile.cache.changes | 5 +++++ python-dogpile.cache.spec | 4 +++- 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 dogpile-threading.patch diff --git a/dogpile-threading.patch b/dogpile-threading.patch new file mode 100644 index 0000000..f046316 --- /dev/null +++ b/dogpile-threading.patch @@ -0,0 +1,40 @@ +From 15fe0d5285b96fcf2472d2c2cdd056b9f91a1290 Mon Sep 17 00:00:00 2001 +From: Mike Bayer +Date: Tue, 4 Jul 2017 10:21:40 -0400 +Subject: [PATCH] - ensure all threads in thread local test stay up until a + flag is set. fixes #116 + +Change-Id: Ic8f781d31ac35372f4fec06b9f98f65a750e6c2e +--- + tests/cache/test_memcached_backend.py | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/tests/cache/test_memcached_backend.py b/tests/cache/test_memcached_backend.py +index 9b83e7d..3793d27 100644 +--- a/tests/cache/test_memcached_backend.py ++++ b/tests/cache/test_memcached_backend.py +@@ -286,14 +286,18 @@ class LocalThreadTest(TestCase): + backend = MockGenericMemcachedBackend(arguments={'url': 'foo'}) + canary = [] + +- def f(): ++ flag = [False] ++ ++ def f(delay): + backend._clients.memcached + canary.append(MockClient.number_of_clients()) +- time.sleep(.05) ++ while not flag[0]: ++ time.sleep(.02) + +- threads = [Thread(target=f) for i in range(count)] ++ threads = [Thread(target=f, args=(count - i, )) for i in range(count)] + for t in threads: + t.start() ++ flag[0] = True + for t in threads: + t.join() + eq_(canary, [i + 1 for i in range(count)]) +-- +2.7.4.1.g5468f9e + diff --git a/python-dogpile.cache.changes b/python-dogpile.cache.changes index 9905f32..3d46032 100644 --- a/python-dogpile.cache.changes +++ b/python-dogpile.cache.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Feb 18 17:35:00 UTC 2018 - dmueller@suse.com + +- add dogpile-threading.patch + ------------------------------------------------------------------- Wed Nov 8 16:29:43 UTC 2017 - alarrosa@suse.com diff --git a/python-dogpile.cache.spec b/python-dogpile.cache.spec index b980646..24974de 100644 --- a/python-dogpile.cache.spec +++ b/python-dogpile.cache.spec @@ -1,7 +1,7 @@ # # spec file for package python-dogpile.cache # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,6 +26,7 @@ License: BSD-3-Clause Group: Development/Languages/Python Url: http://bitbucket.org/zzzeek/dogpile.cache Source: https://pypi.io/packages/source/d/dogpile.cache/dogpile.cache-%{version}.tar.gz +Patch0: dogpile-threading.patch BuildRequires: %{python_module Mako} BuildRequires: %{python_module devel} BuildRequires: %{python_module mock} @@ -55,6 +56,7 @@ new value. %prep %setup -q -n dogpile.cache-%{version} +%patch0 -p1 %build %python_build