Commits

Ryan Williams  committed 3005c24

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

  • Participants
  • Parent commits 9e3efab

Comments (0)

Files changed (1)

File tests/tpool_test.py

 
     @skip_with_pyevent
     def test_wrap_iterator(self):
+        self.reset_timeout(2)
         prox = tpool.Proxy(xrange(10))
         result = []
         for i in prox:
         def tick():
             for i in xrange(20000):
                 counter[0]+=1
-                eventlet.sleep()
+                if counter[0] % 20 == 0:
+                    eventlet.sleep(0.0001)
+                else:
+                    eventlet.sleep()
                 
         gt = eventlet.spawn(tick)
         previtem = 0
             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):