From 7785ef1ac9a00252cf85f0802e0df9362f430837 Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Tue, 27 Oct 2015 15:15:11 +0100 Subject: [PATCH] Use static pool with Pypy on travis --- cliquet/storage/postgresql/client.py | 10 ++++++++++ tox.ini | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cliquet/storage/postgresql/client.py b/cliquet/storage/postgresql/client.py index f441061c..80fce120 100644 --- a/cliquet/storage/postgresql/client.py +++ b/cliquet/storage/postgresql/client.py @@ -1,4 +1,6 @@ import contextlib +import os +import platform import warnings from cliquet import logger @@ -77,6 +79,14 @@ def create_from_config(config, prefix=''): settings[poolclass_key] = config.maybe_dotted(settings[poolclass_key]) settings.pop(prefix + 'max_fetch_size', None) + # There seems to be a problem with the pool implementation using PyPy. + # XXX: Disable pooling at least during tests to avoid stalled tests. + pypy_on_travis = (platform.python_implementation().lower() == 'pypy' and + os.getenv('TRAVIS', False)) + if pypy_on_travis: + warnings.warn('Disable pooling with PyPy on TravisCI') + settings = dict([(poolclass_key, sqlalchemy.pool.StaticPool)]) + engine = sqlalchemy.engine_from_config(settings, prefix=prefix, url=url) # Store one engine per URI. diff --git a/tox.ini b/tox.ini index 31c25eb4..1ab658a3 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ skip_missing_interpreters = True passenv = TRAVIS commands = python --version - nosetests --with-coverage --cover-min-percentage=100 --cover-package=cliquet cliquet {posargs} + nosetests -s -v cliquet {posargs} deps = coverage mock