Commit daf20462 authored by Jason Madden's avatar Jason Madden

EXPECT_POOR_TIMER_RESOLUTION should cover this case too.

parent afe5d1ec
......@@ -107,7 +107,10 @@ if RUNNING_ON_APPVEYOR:
# 'develop' mode (i.e., we install)
NON_APPLICABLE_SUFFIXES.append('corecext')
EXPECT_POOR_TIMER_RESOLUTION = PYPY3 or RUNNING_ON_APPVEYOR or (LIBUV and PYPY)
EXPECT_POOR_TIMER_RESOLUTION = (PYPY3
or RUNNING_ON_APPVEYOR
or (LIBUV and PYPY)
or (CFFI_BACKEND and RUN_COVERAGE))
CONN_ABORTED_ERRORS = []
......
......@@ -225,7 +225,7 @@ class TestCase(TestCaseMetaClass("NewBase", (BaseTestCase,), {})):
self.assertIsInstance(econtext, where_type)
return error
if sysinfo.RUNNING_ON_APPVEYOR:
if sysinfo.EXPECT_POOR_TIMER_RESOLUTION:
# pylint:disable=unused-argument
# appveyor timeouts are unreliable; seems to be very slow wakeups
def assertTimeoutAlmostEqual(self, *args, **kwargs):
......@@ -237,9 +237,9 @@ class TestCase(TestCaseMetaClass("NewBase", (BaseTestCase,), {})):
def assertTimeoutAlmostEqual(self, *args, **kwargs):
self.assertAlmostEqual(*args, **kwargs)
def assertTimeWithinRange(self, delay, min_time, max_time):
self.assertLessEqual(delay, max_time)
self.assertGreaterEqual(delay, min_time)
def assertTimeWithinRange(self, time_taken, min_time, max_time):
self.assertLessEqual(time_taken, max_time)
self.assertGreaterEqual(time_taken, min_time)
def assertMonkeyPatchedFuncSignatures(self, mod_name, func_names=(), exclude=()):
......
......@@ -46,8 +46,9 @@ class _DelayWaitMixin(object):
delay_max_adj=None):
delay_min_adj = self._default_delay_min_adj if not delay_min_adj else delay_min_adj
delay_max_adj = self._default_delay_max_adj if not delay_max_adj else delay_max_adj
self.assertGreaterEqual(delay, timeout - delay_min_adj)
self.assertLess(delay, timeout + delay_max_adj)
self.assertTimeWithinRange(delay,
timeout - delay_min_adj,
timeout + delay_max_adj)
def _wait_and_check(self, timeout=None):
if timeout is None:
......
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