commit 51e9ff3db497f1494a45dbb7525576f8eb1cd278 Author: Arturo Filastò art@fuffa.org Date: Wed Dec 26 16:30:34 2012 +0100
Add more detailed error handling to runner.py --- ooni/runner.py | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/ooni/runner.py b/ooni/runner.py index 7787992..d064756 100644 --- a/ooni/runner.py +++ b/ooni/runner.py @@ -177,7 +177,12 @@ def runTestCasesWithInput(test_cases, test_input, yaml_reporter, return yaml_reporter.testDone(test_instance, test_name) d1 = oonib_reporter.testDone(test_instance, test_name) d2 = yaml_reporter.testDone(test_instance, test_name) - return defer.DeferredList([d1, d2]) + dl = defer.DeferredList([d1, d2]) + @dl.addErrback + def reportingFailed(failure): + log.err("Error in reporting %s" % test_name) + log.exception(failure) + return dl
def test_done(result, test_instance, test_name): log.msg("Finished running %s" % test_name) @@ -232,6 +237,11 @@ def runTestCasesWithInput(test_cases, test_input, yaml_reporter,
test_methods_d = defer.DeferredList(dl) test_methods_d.addCallback(tests_done, test_cases[0][0]) + @test_methods_d.addErrback + def deferredListFailed(failure): + log.err("Error Test Method Deferred List") + log.exception(failure) + return test_methods_d
def runTestCasesWithInputUnit(test_cases, input_unit, yaml_reporter,
tor-commits@lists.torproject.org