Commit 924572a2 authored by Jason Madden's avatar Jason Madden

Increase a few more timers for appveyor

Remove some FLAKY tests from appveyor that should no longer be FLAKY; add test_selectors for 3.5/3.5 because it has timeout-related code that can be flaky there. Remove obsolete failure from PYPY case because we don't support that old version anymore.

test_hub_join_timeout was still flakey on Py 3.4/64-bit appveyor

One finer-grained skip for appveyor
parent 9360ed21
......@@ -494,7 +494,7 @@ class _DelayWaitMixin(object):
_default_delay_max_adj = 0.11
else:
# Timing resolution is extremely poor on Appveyor
_default_delay_max_adj = 0.8
_default_delay_max_adj = 0.9
def wait(self, timeout):
raise NotImplementedError('override me in subclass')
......@@ -511,11 +511,9 @@ class _DelayWaitMixin(object):
if timeout is None:
timeout = self._default_wait_timeout
if hasattr(timeout, 'seconds'):
# gevent.timer instances
seconds = timeout.seconds
else:
seconds = timeout
# gevent.timer instances have a 'seconds' attribute,
# otherwise it's the raw number
seconds = getattr(timeout, 'seconds', timeout)
start = time.time()
try:
......@@ -547,7 +545,7 @@ class GenericWaitTestCase(_DelayWaitMixin, TestCase):
_default_delay_max_adj = 0.11
else:
# Timing resolution is very poor on Appveyor
_default_delay_max_adj = 0.8
_default_delay_max_adj = 0.9
def test_returns_none_after_timeout(self):
result = self._wait_and_check()
......
......@@ -34,6 +34,7 @@ class Error(Exception):
class Test(greentest.TestCase):
@greentest.skipOnAppVeyor("Timing is flaky, especially under Py 3.4/64-bit")
def test_api(self):
# Nothing happens if with-block finishes before the timeout expires
t = Timeout(DELAY * 2)
......
from gevent.socket import create_connection, timeout
from unittest import main
import greentest
import gevent
from gevent.hub import PY3
import util
......@@ -11,13 +10,13 @@ class Test(util.TestServer):
def _run_all_tests(self):
def test_client(message):
if PY3:
if greentest.PY3:
kwargs = {'buffering': 1}
else:
kwargs = {'bufsize': 1}
kwargs['mode'] = 'rb'
conn = create_connection(('127.0.0.1', 16000))
conn.settimeout(0.1)
conn.settimeout(0.1 if not greentest.RUNNING_ON_APPVEYOR else 1.0)
rfile = conn.makefile(**kwargs)
welcome = rfile.readline()
......@@ -38,4 +37,4 @@ class Test(util.TestServer):
if __name__ == '__main__':
main()
greentest.main()
......@@ -18,13 +18,14 @@ from greentest import RUNNING_ON_APPVEYOR
def expected_time(expected, fuzzy=None):
if fuzzy is None:
if RUNNING_ON_APPVEYOR:
fuzzy = expected * 2.0
# The noted timer jitter issues on appveyor
fuzzy = expected * 5.0
else:
fuzzy = expected / 2.0
start = time()
yield
elapsed = time() - start
assert expected - fuzzy <= elapsed <= expected + fuzzy, 'Expected: %r; elapsed: %r' % (expected, elapsed)
assert expected - fuzzy <= elapsed <= expected + fuzzy, 'Expected: %r; elapsed: %r; fuzzy %r' % (expected, elapsed, fuzzy)
def no_time(fuzzy=0.001):
......
......@@ -56,10 +56,6 @@ if sys.platform == 'win32':
# No idea why.
'test__core_fork.py',
'FLAKY test__greenletset.py',
# The various timeout tests are flaky for unknown reasons
# on appveyor
'FLAKY test__timeout.py',
'FLAKY test_hub_join_timeout.py',
# This has been seen to fail on Py3 and Py2 due to socket reuse
# errors, probably timing related again.
'FLAKY test___example_servers.py',
......@@ -85,10 +81,7 @@ if sys.platform == 'win32':
FAILING_TESTS.append('test_ftplib.py')
if PY3:
# XXX need investigating
FAILING_TESTS += [
'FLAKY test__api_timeout.py',
]
pass
if LEAKTEST:
......@@ -116,15 +109,6 @@ if PYPY:
]
import cffi
if cffi.__version_info__ < (1, 2, 0):
FAILING_TESTS += [
# check_sendall_interrupted and testInterruptedTimeout fail due to
# https://bitbucket.org/cffi/cffi/issue/152/handling-errors-from-signal-handlers-in
# See also patched_tests_setup and 'test_signal.InterProcessSignalTests.test_main'
'test_socket.py',
]
if PY26:
FAILING_TESTS += [
......@@ -179,6 +163,12 @@ if sys.version_info[:2] == (3, 3) and os.environ.get('TRAVIS') == 'true':
#'test__refcount_core.py'
]
if sys.version_info[:2] >= (3, 4) and os.environ.get('APPVEYOR'):
FAILING_TESTS += [
# Timing issues on appveyor
'FLAKY test_selectors.py'
]
if COVERAGE:
# The gevent concurrency plugin tends to slow things
# down and get us past our default timeout value. These
......@@ -189,7 +179,7 @@ if COVERAGE:
'FLAKY test__threading_vs_settrace.py',
]
FAILING_TESTS = [x.strip() for x in FAILING_TESTS if x.strip()]
FAILING_TESTS = [x.strip() for x in set(FAILING_TESTS) if x.strip()]
if __name__ == '__main__':
......
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