From 8e99706b16041c8805c70f7e3b67604447d2770e Mon Sep 17 00:00:00 2001 From: Arnold Krille Date: Sat, 27 Feb 2016 17:57:34 +0100 Subject: [PATCH] run python 3.5 on travis, adopt timeouts Also - Report the five slowest tests to watch for risk of timeout - Double timeouts. Maybe that helps pypy on travis to finish successfully. --- .travis.yml | 2 +- tests/test_worker.py | 10 ++++++---- tox.ini | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index eca50b3d..c804c425 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,6 @@ install: - pip install coveralls #- pip install pytest # installed by Travis by default already script: - - RUN_SLOW_TESTS_TOO=1 py.test --cov rq + - RUN_SLOW_TESTS_TOO=1 py.test --cov rq --durations=5 after_success: - coveralls diff --git a/tests/test_worker.py b/tests/test_worker.py index e3177c38..c63f97b6 100644 --- a/tests/test_worker.py +++ b/tests/test_worker.py @@ -578,13 +578,15 @@ def kill_worker(pid, double_kill): class TestWorkerShutdown(RQTestCase): def setUp(self): # we want tests to fail if signal are ignored and the work remain - # running, so set a signal to kill them after 5 seconds + # running, so set a signal to kill them after X seconds + self.killtimeout = 10 signal.signal(signal.SIGALRM, self._timeout) - signal.alarm(5) + signal.alarm(self.killtimeout) def _timeout(self, signal, frame): - raise AssertionError("test still running after 5 seconds, " - "likely the worker wasn't shutdown correctly") + raise AssertionError( + "test still running after %i seconds, likely the worker wasn't shutdown correctly" % self.killtimeout + ) @slow def test_idle_worker_warm_shutdown(self): diff --git a/tox.ini b/tox.ini index 28b6aef8..93a76b97 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ envlist=py26,py27,py33,py34,py35,pypy,flake8 [testenv] -commands=py.test --cov rq {posargs} +commands=py.test --cov rq --durations=5 {posargs} deps= pytest pytest-cov