[Lldb-commits] [lldb] r359503 - [lit] Check for the psutil module when setting a timeout
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Mon Apr 29 14:03:40 PDT 2019
Author: jdevlieghere
Date: Mon Apr 29 14:03:39 2019
New Revision: 359503
URL: http://llvm.org/viewvc/llvm-project?rev=359503&view=rev
Log:
[lit] Check for the psutil module when setting a timeout
Apparently setting the per-test-timeout and not having the psutil
package constitutes to a fatal error. So only set the timeout when the
module is available.
Modified:
lldb/trunk/lit/lit.cfg.py
Modified: lldb/trunk/lit/lit.cfg.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.cfg.py?rev=359503&r1=359502&r2=359503&view=diff
==============================================================================
--- lldb/trunk/lit/lit.cfg.py (original)
+++ lldb/trunk/lit/lit.cfg.py Mon Apr 29 14:03:39 2019
@@ -74,8 +74,14 @@ for i in ['module-cache-clang', 'module-
print("Deleting module cache at %s."%cachedir)
shutil.rmtree(cachedir)
-# Set a default timeout of 10 minutes.
-lit_config.maxIndividualTestTime = 600
+# 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.
+try:
+ import psutil # noqa: F401
+ lit_config.maxIndividualTestTime = 600
+except ImportError:
+ pass
# If running tests natively, check for CPU features needed for some tests.
More information about the lldb-commits
mailing list