Commit 932dcdad authored by Denis Bilenko's avatar Denis Bilenko

test__threadpool.py: increase expected kill.elapsed

To prevent this:

======================================================================
FAIL: test_terminate (__main__.TestPool10)
----------------------------------------------------------------------

Traceback (most recent call last):

File "test__threadpool.py", line 176, in test_terminate

assert kill.elapsed < 0.5, kill.elapsed

AssertionError: 0.564028263092041
parent b44cfbd1
......@@ -169,11 +169,12 @@ class TestPool(TestCase):
self.assertEqual(sorted(it), list(map(sqr, range(10))))
def test_terminate(self):
result = self.pool.map_async(sleep, [0.1] * ((self.size or 10) * 2))
size = self.size or 10
result = self.pool.map_async(sleep, [0.1] * (size * 2))
gevent.sleep(0.1)
kill = TimingWrapper(self.pool.kill)
kill()
assert kill.elapsed < 0.5, kill.elapsed
assert kill.elapsed < 0.1 * self.size + 0.5, kill.elapsed
result.join()
def sleep(self, x):
......
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