From 44e2f44f29a70b8eea6330a8808f7fc5b5d834c8 Mon Sep 17 00:00:00 2001 From: Cyril Bordage Date: Mon, 31 Oct 2022 12:08:44 +0100 Subject: [PATCH] LU-16279 lnet: improve error reporting in LUTF When an error occurs without using an RPC, the error reporting lacks of traceback, listing only the exception itself. This patch adds the traceback to the error string reported by R(). Test-Parameters: @lnet Signed-off-by: Cyril Bordage Change-Id: I3fe5f7628a3f96aeb7941ec75db6b6b5e49e9d84 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48987 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Frank Sehr Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- lustre/tests/lutf/python/infra/lutf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lustre/tests/lutf/python/infra/lutf.py b/lustre/tests/lutf/python/infra/lutf.py index 1d4b751..bec5e6c 100644 --- a/lustre/tests/lutf/python/infra/lutf.py +++ b/lustre/tests/lutf/python/infra/lutf.py @@ -325,7 +325,7 @@ class Script: if type(e) == LUTFError and e.halt: raise e else: - rc = {'status': 'FAIL', 'error': str(e)} + rc = {'status': 'FAIL', 'error': traceback.format_exc()} skip_test = True if skip_test: rc['reason'] = 'Test setup cleanup failed' @@ -346,7 +346,7 @@ class Script: if type(e) == LUTFError and e.halt: raise e else: - rc = {'status': 'FAIL', 'error': str(e)} + rc = {'status': 'FAIL', 'error': traceback.format_exc()} logging.debug("Finished test script: %s" % str(self.name)) duration = datetime.datetime.now() - start_time -- 1.8.3.1