diff --git a/circus/client.py b/circus/client.py index 75ae0cf9e..490742eb7 100644 --- a/circus/client.py +++ b/circus/client.py @@ -67,6 +67,7 @@ def call(self, cmd): try: future = concurrent.Future() + def cb(msg, status): future.set_result(msg) self.stream.send(cmd, callback=cb) diff --git a/circus/tests/support.py b/circus/tests/support.py index 999632a6f..c2e77f31f 100644 --- a/circus/tests/support.py +++ b/circus/tests/support.py @@ -473,6 +473,7 @@ def is_alive(self): def stop(self): pass + class MagicMockFuture(mock.MagicMock, concurrent.futures.Future): def cancel(self): diff --git a/circus/tests/test_arbiter.py b/circus/tests/test_arbiter.py index 1fb4472ad..3198d9719 100644 --- a/circus/tests/test_arbiter.py +++ b/circus/tests/test_arbiter.py @@ -500,6 +500,7 @@ def test_plugins(self): loop=get_ioloop()) def incr_processes(cli): + # return a coroutine if cli is Async return cli.send_message('incr', name='test') # wait for the plugin to be started @@ -511,7 +512,6 @@ def incr_processes(cli): res = yield cli.send_message('list', name='test') self.assertEqual(len(res.get('pids')), 1) - # XXX: NOT SURE, yield make procedure sync yield incr_processes(cli) res = yield cli.send_message('list', name='test') self.assertEqual(len(res.get('pids')), 2) diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index 8aa15f09c..74971b697 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -4,6 +4,7 @@ Changelog history unreleased ---------- +- Drop support for tornado<5 and start using asyncio eventl loop - #1129 - Fix mem_info readings to be more reliable - #1128 - Drop support for Python 2.7 & 3.4 - #1126 - Speedup reloadconfig for large number of sockets - #1121 diff --git a/examples/test.sh b/examples/test.sh index fae14ff24..61b584faa 100755 --- a/examples/test.sh +++ b/examples/test.sh @@ -1,2 +1,3 @@ #!/bin/sh -;sleep 1 +sleep 1 +echo "@@@" diff --git a/setup.py b/setup.py index a6d8ea1d9..db7319816 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ raise SystemExit("Circus requires Python 3.5 or higher.") -install_requires = ['psutil', 'pyzmq>=17.0', 'tornado>=3.0,<5.0'] +install_requires = ['psutil', 'pyzmq>=17.0', 'tornado>=5.0.2'] try: import argparse # NOQA @@ -46,7 +46,6 @@ 'gevent', 'papa', 'PyYAML', - 'tornado>=3.0,<5.0', 'pyzmq>=17.0', 'flake8==2.1.0', ], diff --git a/tox.ini b/tox.ini index 900c9c3fb..7ec5b51ab 100644 --- a/tox.ini +++ b/tox.ini @@ -12,7 +12,7 @@ deps = gevent papa PyYAML - tornado>=3.0,<5.0 + tornado>=5.0.2 pyzmq>=17.0 setenv =