[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.
This commit is contained in:
Richard Mathot
2017-06-16 14:21:12 +02:00
parent ff8c2d66a1
commit 2dcf233a28
+7
View File
@@ -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")