From 32b6b0e934ff3ec08f4fa3bcf8b832cc8bff80a1 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 25 Apr 2016 11:59:37 +0200 Subject: convwatch: if a document fails to load, log that instead of failing Bugzillas have lots of zip-files with wrong mime-types and non-well-formed files. Change-Id: I1238a35da0f222759439316a33b8927a3544a965 --- bin/convwatch.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/convwatch.py b/bin/convwatch.py index fe091f3420ab..1b055e109761 100644 --- a/bin/convwatch.py +++ b/bin/convwatch.py @@ -14,6 +14,7 @@ import sys import time import uuid import datetime +import traceback try: from urllib.parse import quote except ImportError: @@ -194,6 +195,18 @@ def simpleInvoke(connection, test): finally: connection.postTest() +def logExceptionInvoke(connection, test): + try: + connection.preTest() + test.run(connection.getContext()) + except KeyboardInterrupt: + raise # Ctrl+C should work + except: + estr = traceback.format_exc() + log("logExceptionInvoke: FAILED with exception:\n" + estr) + finally: + connection.postTest() + def retryInvoke(connection, test): tries = 5 while tries > 0: @@ -308,7 +321,7 @@ def runLoadPrintFileTests(opts, dirs, suffix, reference): tests = (LoadPrintFileTest(file, prtsuffix) for file in files) connection = PersistentConnection(opts) # connection = PerTestConnection(opts) - runConnectionTests(connection, simpleInvoke, tests) + runConnectionTests(connection, logExceptionInvoke, tests) def mkImages(file, resolution): argv = [ "gs", "-r" + resolution, "-sOutputFile=" + file + ".%04d.jpeg", -- cgit