Commit c0f8c968 authored by Denis Bilenko's avatar Denis Bilenko

greentest.py: don't fail if timer executes a bit earlier than it supposed to (happens on windows)

parent bb535ed9
......@@ -127,7 +127,7 @@ class GenericWaitTestCase(TestCase):
result = self.wait(timeout=0.01)
# join and wait simply returns after timeout expires
delay = time.time() - start
assert 0.01 <= delay < 0.01 + 0.01, delay
assert 0.01 - 0.001 <= delay < 0.01 + 0.01, delay
assert result is None, repr(result)
......@@ -143,7 +143,7 @@ class GenericGetTestCase(TestCase):
self.assertRaises(gevent.Timeout, self.wait, timeout=0.01)
# get raises Timeout after timeout expired
delay = time.time() - start
assert 0.01 <= delay < 0.01 + 0.01, delay
assert 0.01 - 0.001 <= delay < 0.01 + 0.01, delay
def test_raises_timeout_Timeout(self):
start = time.time()
......@@ -153,7 +153,7 @@ class GenericGetTestCase(TestCase):
except gevent.Timeout, ex:
assert ex is timeout, (ex, timeout)
delay = time.time() - start
assert 0.01 <= delay < 0.01 + 0.01, delay
assert 0.01 - 0.001 <= delay < 0.01 + 0.01, delay
def test_raises_timeout_Timeout_exc_customized(self):
start = time.time()
......@@ -164,5 +164,5 @@ class GenericGetTestCase(TestCase):
except RuntimeError, ex:
assert ex is error, (ex, error)
delay = time.time() - start
assert 0.01 <= delay < 0.01 + 0.01, delay
assert 0.01 - 0.001 <= delay < 0.01 + 0.01, delay
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment