forked from pool/python-dogpile.cache
- add dogpile-threading.patch
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dogpile.cache?expand=0&rev=30
This commit is contained in:
40
dogpile-threading.patch
Normal file
40
dogpile-threading.patch
Normal file
@@ -0,0 +1,40 @@
|
||||
From 15fe0d5285b96fcf2472d2c2cdd056b9f91a1290 Mon Sep 17 00:00:00 2001
|
||||
From: Mike Bayer <mike_mp@zzzcomputing.com>
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user