This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch 9.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/9.1.x by this push:
new 818d7d1 replace psutil.pid() with psutil.process_iter() for safer
execution (#7515)
818d7d1 is described below
commit 818d7d152316b00c65ee716b320a1a59059389f7
Author: Fei Deng <[email protected]>
AuthorDate: Wed Feb 10 21:14:31 2021 -0600
replace psutil.pid() with psutil.process_iter() for safer execution (#7515)
(cherry picked from commit 6abea9063bfb0fa0b2d398bcf41d341f2e09f694)
---
tests/gold_tests/thread_config/check_threads.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tests/gold_tests/thread_config/check_threads.py
b/tests/gold_tests/thread_config/check_threads.py
index 7cc46c9..6cc5801 100755
--- a/tests/gold_tests/thread_config/check_threads.py
+++ b/tests/gold_tests/thread_config/check_threads.py
@@ -23,12 +23,11 @@ import sys
def count_threads(ts_path, etnet_threads, accept_threads):
- for pid in psutil.pids():
+ for p in psutil.process_iter(['name', 'cwd', 'threads']):
# Find the pid corresponding to the ats process we started in autest.
# It needs to match the process name and the binary path.
# If autest can expose the pid of the process this is not needed
anymore.
- p = psutil.Process(pid)
if p.name() == '[TS_MAIN]' and p.cwd() == ts_path:
etnet_check = set()