# HG changeset patch # User Denis Laxalde # Date 1477296516 -7200 # Node ID 7cf5a915e2e91a05eb8386456c41ac11d554f113 # Parent f79dc500a4e7c869c89f5ac873c4844d4bb8c496 [devtools/qunit] Retain firefox process stdout to eventually print it The bare RuntimeError that gets emitted upon timeout does not help much to diagnose the problem. Let's see if we can get more information from stdout by not dropping it. diff -r f79dc500a4e7 -r 7cf5a915e2e9 cubicweb/devtools/qunit.py --- a/cubicweb/devtools/qunit.py Mon Oct 24 09:45:38 2016 +0200 +++ b/cubicweb/devtools/qunit.py Mon Oct 24 10:08:36 2016 +0200 @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . -from __future__ import absolute_import +from __future__ import absolute_import, print_function import os, os.path as osp import errno @@ -72,12 +72,16 @@ return False, msg raise + @property + def log_file(self): + return osp.join(self._profile_dir, 'cwtest.log') + def start(self): self.stop() cmd = self.firefox_cmd + ['-silent', '--profile', self._profile_dir, '-url', self._url] - with open(os.devnull, 'w') as fnull: - self._process = Popen(cmd, stdout=fnull, stderr=fnull) + with open(self.log_file, 'wb') as fout: + self._process = Popen(cmd, stdout=fout, stderr=STDOUT) def stop(self): if self._process is not None: @@ -142,6 +146,8 @@ error = False def runtime_error(*data): + with open(browser.log_file) as logf: + print(logf.read()) raise RuntimeError(*data) while not error: