15
0
2018-02-18 17:35:07 +00:00
committed by Git OBS Bridge
parent 3784be78c1
commit a35e3626c5
3 changed files with 48 additions and 1 deletions

40
dogpile-threading.patch Normal file
View 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

View File

@@ -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

View File

@@ -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