From 0f182558484ec7964413fc93f6361f0842135b2b Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Mon, 19 Oct 2020 19:54:23 +0200 Subject: [PATCH] Reverted "Reduced time.sleep() in cache touch() tests." This reverts commit 177a49e79c882603da64d45995f5fd60dce8c852 which caused more frequent failures of test_touch(). --- tests/cache/tests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/cache/tests.py b/tests/cache/tests.py index 2a3bf57354..1ef2cc1bc1 100644 --- a/tests/cache/tests.py +++ b/tests/cache/tests.py @@ -440,15 +440,15 @@ class BaseCacheTests: def test_touch(self): # cache.touch() updates the timeout. cache.set('expire1', 'very quickly', timeout=1) - self.assertIs(cache.touch('expire1', timeout=2), True) - time.sleep(1.0) + self.assertIs(cache.touch('expire1', timeout=4), True) + time.sleep(2) self.assertIs(cache.has_key('expire1'), True) - time.sleep(1.5) + time.sleep(3) self.assertIs(cache.has_key('expire1'), False) # cache.touch() works without the timeout argument. cache.set('expire1', 'very quickly', timeout=1) self.assertIs(cache.touch('expire1'), True) - time.sleep(1.5) + time.sleep(2) self.assertIs(cache.has_key('expire1'), True) self.assertIs(cache.touch('nonexistent'), False)