[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.
This commit is contained in:
Jairo Llopis
2017-06-01 11:51:24 +02:00
committed by Yannick Tivisse
parent a5565cde76
commit a567cd796e
+3
View File
@@ -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)