Commit 6cc31547 authored by Jason Madden's avatar Jason Madden

Tweak timeout for PyPy3 that fails on travis sometimes.

parent 8b40093a
......@@ -84,6 +84,8 @@ elif sys.version_info[0] == 2:
# Python 2, < 2.7.9
NON_APPLICABLE_SUFFIXES.append('279')
PYPY3 = PYPY and PY3
if sys.platform.startswith('win'):
NON_APPLICABLE_SUFFIXES.append("posix")
# This is intimately tied to FileObjectPosix
......@@ -113,7 +115,7 @@ else:
return f
return dec
if PYPY and PY3 and RUNNING_ON_CI:
if PYPY3 and RUNNING_ON_CI:
# Same as above, for PyPy3.3-5.5-alpha
skipOnPyPy3OnCI = unittest.skip
else:
......@@ -122,6 +124,8 @@ else:
return f
return dec
EXPECT_POOR_TIMER_RESOLUTION = PYPY3 or RUNNING_ON_APPVEYOR
class ExpectedException(Exception):
"""An exception whose traceback should be ignored"""
......
......@@ -11,14 +11,13 @@ FUZZY = SMALL / 2
# setting up signal does not affect join()
gevent.signal(1, lambda: None) # wouldn't work on windows
from greentest import RUNNING_ON_APPVEYOR
from greentest import EXPECT_POOR_TIMER_RESOLUTION
@contextmanager
def expected_time(expected, fuzzy=None):
if fuzzy is None:
if RUNNING_ON_APPVEYOR:
# The noted timer jitter issues on appveyor
if EXPECT_POOR_TIMER_RESOLUTION:
# The noted timer jitter issues on appveyor/pypy3
fuzzy = expected * 5.0
else:
fuzzy = expected / 2.0
......@@ -28,7 +27,7 @@ def expected_time(expected, fuzzy=None):
assert expected - fuzzy <= elapsed <= expected + fuzzy, 'Expected: %r; elapsed: %r; fuzzy %r' % (expected, elapsed, fuzzy)
def no_time(fuzzy=(0.001 if not RUNNING_ON_APPVEYOR else 1.0)):
def no_time(fuzzy=(0.001 if not EXPECT_POOR_TIMER_RESOLUTION else 1.0)):
return expected_time(0, fuzzy=fuzzy)
......
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