This seems reasonable. My only concern would be that there could be cases which now don't log at all; for example on a server test that client/bin/parallel.py code isn't likely to be in use. Still, it does re-raise the exception so it's likely to get logged somewhere, I would hope.
-- John On Sun, Jul 17, 2011 at 8:55 PM, Lucas Meneghel Rodrigues <[email protected]> wrote: > Currently, in both the test code and the parallel execution > code we log the exceptions that happened during a test's > execution, which means we log the same exception in 2 different > places. It looks like too much error duplication in logs. Also, > even exceptions that we expect to see in logs, such as > error.TestFail (which basically marks a test as FAILed) will > produce the same result. > > So, let's just log the exceptions as DEBUG messages on client's > debug log. This way, test authors can still see errors and > debug their test code if they chose to execute autotest with > --verbose or look at the DEBUG logs of the client. > > Signed-off-by: Lucas Meneghel Rodrigues <[email protected]> > --- > client/bin/parallel.py | 3 ++- > client/common_lib/test.py | 5 ----- > 2 files changed, 2 insertions(+), 6 deletions(-) > > diff --git a/client/bin/parallel.py b/client/bin/parallel.py > index c426968..cb02082 100644 > --- a/client/bin/parallel.py > +++ b/client/bin/parallel.py > @@ -26,7 +26,8 @@ def fork_start(tmp, l): > logging.error('child process failed') > # logging.exception() uses ERROR level, but we want DEBUG for > # the traceback > - logging.debug(traceback.format_exc()) > + for line in traceback.format_exc().splitlines(): > + logging.debug(line) > finally: > # note that exceptions originating in this block won't make it > # to the logs > diff --git a/client/common_lib/test.py b/client/common_lib/test.py > index a1d68ab..ccca585 100644 > --- a/client/common_lib/test.py > +++ b/client/common_lib/test.py > @@ -417,11 +417,6 @@ class base_test(object): > > _call_test_function(self.execute, *p_args, **p_dargs) > except Exception: > - try: > - logging.exception('Exception escaping from test:') > - except: > - pass # don't let logging exceptions here interfere > - > # Save the exception while we run our cleanup() before > # reraising it. > exc_info = sys.exc_info() > -- > 1.7.6 > > _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
