More tinkering with the iterator tests to cut down on false positives.

This commit is contained in:
Ryan Williams
2010-03-29 00:15:57 -07:00
parent ff6ccafb2a
commit ff28a07925

View File

@@ -133,6 +133,7 @@ class TestTpool(LimitedTestCase):
@skip_with_pyevent
def test_wrap_iterator(self):
self.reset_timeout(2)
prox = tpool.Proxy(xrange(10))
result = []
for i in prox:
@@ -152,6 +153,9 @@ class TestTpool(LimitedTestCase):
def tick():
for i in xrange(20000):
counter[0]+=1
if counter[0] % 20 == 0:
eventlet.sleep(0.0001)
else:
eventlet.sleep()
gt = eventlet.spawn(tick)
@@ -160,9 +164,9 @@ class TestTpool(LimitedTestCase):
self.assert_(item >= previtem)
# make sure the tick happened at least a few times so that we know
# that our iterations in foo() were actually tpooled
print counter[0]
self.assert_(counter[0] > 10, counter[0])
gt.wait()
gt.kill()
@skip_with_pyevent
def test_raising_exceptions(self):