From a567cd796e75a5f019b35237de8304f0e771bf43 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 1 Jun 2017 11:33:34 +0200 Subject: [PATCH] [IMP] service: Display a warning when launching tests in multi-workers mode Indeed, running the testsuite is not supported in multi-process (worker/pre-fork) mode, for multiple reasons: no multiple/concurrent execution of tests, necessity for in-memory cross-request statefulness (test cursor), etc. We have no plan to work around these issues, as there seems to be no strong use case. Our testsuite is mainly focused on the business/framework aspects, and not scalability/deployment aspects - which would require a much more complicated test infrastructure. --- odoo/service/server.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/odoo/service/server.py b/odoo/service/server.py index b4f3dca6c1b..9bbbc627a42 100644 --- a/odoo/service/server.py +++ b/odoo/service/server.py @@ -952,6 +952,9 @@ def start(preload=None, stop=False): if odoo.evented: server = GeventServer(odoo.service.wsgi_server.application) elif config['workers']: + if config['test_enable'] or config['test_file']: + _logger.warning("Unit testing in workers mode could fail; use --workers 0.") + server = PreforkServer(odoo.service.wsgi_server.application) else: server = ThreadedServer(odoo.service.wsgi_server.application)