From 2dcf233a2801a6fda0cb03f47aca83182b7803ce Mon Sep 17 00:00:00 2001 From: Richard Mathot Date: Wed, 7 Jun 2017 14:14:58 +0200 Subject: [PATCH] [IMP] tests: better reporting of PhantomJS crashes When PhantomJS crashes due to a memory leak/segmentation fault, it will now be logged, allowing to distinguishes timeouts from crashes more easily. --- odoo/tests/common.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/odoo/tests/common.py b/odoo/tests/common.py index b0f601f284a..15d17dbf611 100644 --- a/odoo/tests/common.py +++ b/odoo/tests/common.py @@ -382,6 +382,13 @@ class HttpCase(TransactionCase): if phantom.poll() is None: phantom.terminate() phantom.wait() + + # check PhantomJS health + from signal import SIGSEGV + _logger.info("Phantom JS return code: %d" % phantom.returncode) + if phantom.returncode == -SIGSEGV: + _logger.error("Phantom JS has crashed (segmentation fault) during testing; log may not be relevant") + self._wait_remaining_requests() # we ignore phantomjs return code as we kill it as soon as we have ok _logger.info("phantom_run execution finished")