From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3551DA04DB; Tue, 17 Nov 2020 10:28:48 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0083D4C90; Tue, 17 Nov 2020 10:28:47 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id F0FE337B1 for ; Tue, 17 Nov 2020 10:28:44 +0100 (CET) IronPort-SDR: TJxD5CFJjuvwB+YZLNbZti+bFZcl5fQKIoBhujCr/24sW9pZhUz2NyPXyrXMXk/oGGz/j8XTxC o06Qkq3UfCxg== X-IronPort-AV: E=McAfee;i="6000,8403,9807"; a="167381752" X-IronPort-AV: E=Sophos;i="5.77,485,1596524400"; d="scan'208";a="167381752" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2020 01:21:39 -0800 IronPort-SDR: +GrqwaRYJQmkccsI0/L9+HbseBdEr1ZhhBUdQt43io7co4LLRcrhHWgjN9pAB8uUXnz5w4mfyT Pb/uHQUYGKfQ== X-IronPort-AV: E=Sophos;i="5.77,485,1596524400"; d="scan'208";a="310160638" Received: from unknown (HELO localhost.localdomain) ([10.240.183.57]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2020 01:21:37 -0800 From: Haiyang Zhao To: lijuan.tu@intel.com, dts@dpdk.org Cc: Haiyang Zhao Date: Tue, 17 Nov 2020 17:15:10 +0800 Message-Id: <20201117091510.7932-1-haiyangx.zhao@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V1] framework/dts: capture exception generated in finnaly sentence X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" if exception raised in execute_tear_downall, the result will not be saved and DTS will be terminated, capture the exception to fix it. Signed-off-by: Haiyang Zhao --- framework/dts.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/framework/dts.py b/framework/dts.py index 8a3790e..8c61385 100644 --- a/framework/dts.py +++ b/framework/dts.py @@ -486,8 +486,16 @@ def dts_run_suite(duts, tester, test_suites, target, subtitle): settings.report_error("GENERIC_ERR") log_handler.error(str(e)) finally: - suite_obj.execute_tear_downall() - save_all_results() + try: + suite_obj.execute_tear_downall() + except Exception as e: + settings.report_error("GENERIC_ERR") + log_handler.error(str(e)) + try: + save_all_results() + except Exception as e: + settings.report_error("GENERIC_ERR") + log_handler.error(str(e)) def run_all(config_file, pkgName, git, patch, skip_setup, -- 2.17.1