Commit 948aa7d1 authored by Jason Madden's avatar Jason Madden

More flaky test markers

parent 9b73bfab
......@@ -295,7 +295,12 @@ class EventTests(BaseTestCase):
self.assertEqual(results1, [False] * N)
for r, dt in results2:
self.assertFalse(r)
self.assertTrue(dt >= 0.2, dt)
#self.assertTrue(dt >= 0.2, dt)
# gevent: With libuv, timers are slightly variable
# (and coalesce?). Sometimes the sleep is
# 0.00004 less than expected, e.g., 0.199996
self.assertTrue(dt >= 0.18, dt)
# The event is set
results1 = []
results2 = []
......
......@@ -192,8 +192,15 @@ class FlakyTestTimeout(FlakyTest):
unexpected timeout.
"""
def reraiseFlakyTestRaceCondition():
six.reraise(*sys.exc_info())
reraiseFlakyTestTimeout = reraiseFlakyTestRaceCondition
reraiseFlakyTestRaceConditionLibuv = reraiseFlakyTestRaceCondition
reraiseFlakyTestTimeoutLibuv = reraiseFlakyTestRaceCondition
if RUNNING_ON_CI:
# pylint: disable=function-redefined
def reraiseFlakyTestRaceCondition():
six.reraise(FlakyTestRaceCondition,
FlakyTestRaceCondition('\n'.join(dump_stacks())),
......@@ -204,11 +211,10 @@ if RUNNING_ON_CI:
FlakyTestTimeout(),
sys.exc_info()[2])
else:
def reraiseFlakyTestRaceCondition():
six.reraise(*sys.exc_info())
if LIBUV:
reraiseFlakyTestRaceConditionLibuv = reraiseFlakyTestRaceCondition
reraiseFlakyTestTimeoutLibuv = reraiseFlakyTestTimeout
reraiseFlakyTestTimeout = reraiseFlakyTestRaceCondition
def wrap_switch_count_check(method):
@wraps(method)
......
......@@ -93,10 +93,8 @@ class TestCoroutinePool(unittest.TestCase):
pool.apply_async(evt.set)
evt.wait()
@greentest.skipOnPyPy("Does not work on PyPy") # Why?
def test_stderr_raising(self):
if greentest.PYPY:
# Does not work on PyPy
return
# testing that really egregious errors in the error handling code
# (that prints tracebacks to stderr) don't cause the pool to lose
# any members
......@@ -301,7 +299,7 @@ TIMEOUT1, TIMEOUT2, TIMEOUT3 = 0.082, 0.035, 0.14
class TestPool(greentest.TestCase):
__timeout__ = 5 if not greentest.RUNNING_ON_APPVEYOR else 20
__timeout__ = max(greentest.TestCase.__timeout__, 5)
size = 1
def setUp(self):
......
......@@ -342,7 +342,10 @@ class TestMaxsize(TestCase):
self.assertEqual(done, [])
self.pool.maxsize = 1
gevent.sleep(0.01)
self.assertEqual(done, [1, 2])
try:
self.assertEqual(done, [1, 2])
except AssertionError:
greentest.reraiseFlakyTestRaceConditionLibuv()
def test_setzero(self):
pool = self.pool = ThreadPool(3)
......
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