[Lldb-commits] [lldb] r366912 - [AIX][lit] Don't depend on psutil on AIX

David Tenty via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 24 08:04:27 PDT 2019

Author: daltenty
Date: Wed Jul 24 08:04:27 2019
New Revision: 366912

URL: http://llvm.org/viewvc/llvm-project?rev=366912&view=rev
[AIX][lit] Don't depend on psutil on AIX

On AIX psutil can run into problems with permissions to read the process
tree, which causes problems for python timeout tests which need to kill off
a test and it's children.

This patch adds a workaround by invoking shell via subprocess and using a
platform specific option to ps to list all the descendant processes so we can
kill them. We add some checks so lit can tell whether timeout tests are
supported with out exposing whether we are utilizing the psutil
implementation or the alternative.

Reviewers: hubert.reinterpretcast, andusy, davide, delcypher

Reviewed By: delcypher

Subscribers: davide, delcypher, christof, lldb-commits, libcxx-commits, llvm-commits

Tags: #lldb, #libc, #llvm

Differential Revision: https://reviews.llvm.org/D64251


Modified: lldb/trunk/lit/lit.cfg.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.cfg.py?rev=366912&r1=366911&r2=366912&view=diff
--- lldb/trunk/lit/lit.cfg.py (original)
+++ lldb/trunk/lit/lit.cfg.py Wed Jul 24 08:04:27 2019
@@ -1,6 +1,7 @@
 # -*- Python -*-
 import os
+import platform
 import re
 import shutil
 import site
@@ -75,13 +76,14 @@ for i in ['module-cache-clang', 'module-
 # Set a default per-test timeout of 10 minutes. Setting a timeout per test
-# requires the psutil module and lit complains if the value is set but the
-# module can't be found.
-    import psutil  # noqa: F401
+# requires that killProcessAndChildren() is supported on the platform and
+# lit complains if the value is set but it is not supported.
+supported, errormsg = lit_config.maxIndividualTestTimeIsSupported
+if supported:
     lit_config.maxIndividualTestTime = 600
-except ImportError:
-    pass
+    lit_config.warning("Could not set a default per-test timeout. " + errormsg)
 # If running tests natively, check for CPU features needed for some tests.

More information about the lldb-commits mailing list