File: remove-non-deterministic-tests.patch

package info (click to toggle)
python-dogpile.cache 1.3.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 772 kB
  • sloc: python: 5,462; makefile: 155; sh: 104
file content (84 lines) | stat: -rw-r--r-- 2,879 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Description: Remove non-deterministic tests
Author: Thomas Goirand <zigo@debian.org>
Bug-Debian: https://bugs.debian.org/841516
Bug-Debian: https://bugs.debian.org/861173
Forwarded: no
Last-Update: 2020-03-07

Index: python-dogpile.cache/tests/cache/test_memcached_backend.py
===================================================================
--- python-dogpile.cache.orig/tests/cache/test_memcached_backend.py
+++ python-dogpile.cache/tests/cache/test_memcached_backend.py
@@ -499,46 +499,3 @@
         )
         backend.set("foo", "bar")
         eq_(backend._clients.memcached.canary, [{"min_compress_len": 20}])
-
-
-class LocalThreadTest:
-    @pytest.fixture(autouse=True)
-    def _collect_gc(self):
-        import gc
-
-        gc.collect()
-        eq_(MockClient.number_of_clients(), 0)
-
-    def test_client_cleanup_1(self):
-        self._test_client_cleanup(1)
-
-    def test_client_cleanup_3(self):
-        self._test_client_cleanup(3)
-
-    def test_client_cleanup_10(self):
-        self._test_client_cleanup(10)
-
-    def _test_client_cleanup(self, count):
-        backend = MockGenericMemcachedBackend(arguments={"url": "foo"})
-        canary = []
-
-        flag = [False]
-
-        def f(delay):
-            backend._clients.memcached
-            canary.append(MockClient.number_of_clients())
-            while not flag[0]:
-                time.sleep(0.02)
-
-        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)])
-
-        import gc
-
-        gc.collect()
-        eq_(MockClient.number_of_clients(), 0)
Index: python-dogpile.cache/tests/test_lock.py
===================================================================
--- python-dogpile.cache.orig/tests/test_lock.py
+++ python-dogpile.cache/tests/test_lock.py
@@ -24,10 +24,6 @@ class ConcurrencyTest(TestCase):
     def test_quick(self):
         self._test_multi(10, 2, 0.5, 50, 0.05, 0.1)
 
-    @pytest.mark.time_intensive
-    def test_slow(self):
-        self._test_multi(10, 5, 2, 50, 0.1, 0.1)
-
     # TODO: this is a port from the legacy test_dogpile test.
     # sequence and calculations need to be revised.
     # def test_get_value_plus_created_slow_write(self):
@@ -54,10 +50,6 @@ class ConcurrencyTest(TestCase):
     def test_get_value_plus_created_registry_safe_cache_quick(self):
         self._test_multi(10, 2, 0.5, 50, 0.05, 0.1, cache_expire_time="safe")
 
-    @pytest.mark.time_intensive
-    def test_get_value_plus_created_registry_safe_cache_slow(self):
-        self._test_multi(10, 5, 2, 50, 0.1, 0.1, cache_expire_time="safe")
-
     def _assert_synchronized(self):
         acq = self._assertion_lock.acquire(False)
         assert acq, "Could not acquire"