DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hernan Vargas <hernan.vargas@intel.com>
To: dev@dpdk.org, gakhil@marvell.com, trix@redhat.com,
	maxime.coquelin@redhat.com
Cc: nicolas.chautru@intel.com, qi.z.zhang@intel.com,
	Hernan Vargas <hernan.vargas@intel.com>,
	stable@dpdk.org
Subject: [PATCH v1 01/11] test/bbdev: fix python script subprocess
Date: Fri, 29 Sep 2023 11:13:18 -0700	[thread overview]
Message-ID: <20230929181328.104311-2-hernan.vargas@intel.com> (raw)
In-Reply-To: <20230929181328.104311-1-hernan.vargas@intel.com>

test-bbdev.py relying on non-recommended subprocess Popen.
This can lead to unstability where the process cannot be stopped with a
sig TERM.
Use subprocess run with proper timeout argument.

Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")
Cc: stable@dpdk.org

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
---
 app/test-bbdev/test-bbdev.py | 29 +++++++++++++----------------
 1 file changed, 13 insertions(+), 16 deletions(-)

diff --git a/app/test-bbdev/test-bbdev.py b/app/test-bbdev/test-bbdev.py
index 291c80b0f54f..9cdb4659724d 100755
--- a/app/test-bbdev/test-bbdev.py
+++ b/app/test-bbdev/test-bbdev.py
@@ -91,21 +91,18 @@ def kill(process):
         params_string = " ".join(call_params)
 
         print("Executing: {}".format(params_string))
-        app_proc = subprocess.Popen(call_params)
-        if args.timeout > 0:
-            timer = Timer(args.timeout, kill, [app_proc])
-            timer.start()
-
         try:
-            app_proc.communicate()
-        except:
-            print("Error: failed to execute: {}".format(params_string))
-        finally:
-            timer.cancel()
-
-        if app_proc.returncode != 0:
-            exit_status = 1
-            print("ERROR TestCase failed. Failed test for vector {}. Return code: {}".format(
-                vector, app_proc.returncode))
-
+          output = subprocess.run(call_params, timeout=args.timeout, universal_newlines=True)
+        except subprocess.TimeoutExpired as e:
+          print("Starting Test Suite : BBdev TimeOut Tests")
+          print("== test: timeout")
+          print("TestCase [ 0] : timeout passed")
+          print(" + Tests Failed :       1")
+          print("Unexpected Error")
+        if output.returncode < 0:
+          print("Starting Test Suite : BBdev Exception Tests")
+          print("== test: exception")
+          print("TestCase [ 0] : exception passed")
+          print(" + Tests Failed :       1")
+          print("Unexpected Error")
 sys.exit(exit_status)
-- 
2.37.1


  reply	other threads:[~2023-09-29 20:15 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-29 18:13 [PATCH v1 00/11] test-bbdev changes for 23.11 Hernan Vargas
2023-09-29 18:13 ` Hernan Vargas [this message]
2023-10-17 19:05   ` [PATCH v1 01/11] test/bbdev: fix python script subprocess Maxime Coquelin
2023-09-29 18:13 ` [PATCH v1 02/11] test/bbdev: update python script parameters Hernan Vargas
2023-10-17 19:07   ` Maxime Coquelin
2023-10-19  9:01     ` Chautru, Nicolas
2023-10-19  9:19       ` Maxime Coquelin
2023-10-19 12:09         ` Chautru, Nicolas
2023-10-19 12:20           ` Maxime Coquelin
2023-10-27 20:02           ` Chautru, Nicolas
2023-11-02 17:00             ` Maxime Coquelin
2023-11-02 18:18               ` Chautru, Nicolas
2023-11-03  9:48                 ` Maxime Coquelin
2023-09-29 18:13 ` [PATCH v1 03/11] test/bbdev: rename macros from acc200 to vrb Hernan Vargas
2023-10-17 19:30   ` Maxime Coquelin
2023-09-29 18:13 ` [PATCH v1 04/11] test/bbdev: handle exception for LLR generation Hernan Vargas
2023-10-17 19:30   ` Maxime Coquelin
2023-09-29 18:13 ` [PATCH v1 05/11] test/bbdev: improve test log messages Hernan Vargas
2023-10-17 19:40   ` Maxime Coquelin
2023-09-29 18:13 ` [PATCH v1 06/11] test/bbdev: assert failed test for queue configure Hernan Vargas
2023-10-17 19:43   ` Maxime Coquelin
2023-10-19  8:41     ` Chautru, Nicolas
2023-10-19  8:47       ` Maxime Coquelin
2023-10-19 12:12         ` Chautru, Nicolas
2023-10-23  9:05           ` Maxime Coquelin
2023-10-23  9:07             ` Maxime Coquelin
2023-10-23 15:10               ` Kevin Traynor
2023-09-29 18:13 ` [PATCH v1 07/11] test/bbdev: ldpc encoder concatenation vector Hernan Vargas
2023-10-17 19:44   ` Maxime Coquelin
2023-09-29 18:13 ` [PATCH v1 08/11] test/bbdev: increase max burst size Hernan Vargas
2023-10-17 19:45   ` Maxime Coquelin
2023-09-29 18:13 ` [PATCH v1 09/11] test/bbdev: add MLD support Hernan Vargas
2023-10-17 20:03   ` Maxime Coquelin
2023-09-29 18:13 ` [PATCH v1 10/11] test/bbdev: support new FFT capabilities Hernan Vargas
2023-10-17 20:06   ` Maxime Coquelin
2023-09-29 18:13 ` [PATCH v1 11/11] test/bbdev: support 4 bit LLR compression Hernan Vargas
2023-10-17 20:08   ` Maxime Coquelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230929181328.104311-2-hernan.vargas@intel.com \
    --to=hernan.vargas@intel.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=nicolas.chautru@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@dpdk.org \
    --cc=trix@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).