[AIX][lit] Don't depend on psutil on AIX
Summary:
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
llvm-svn: 366912
2019-07-24 23:04:27 +08:00
|
|
|
# REQUIRES: lit-max-individual-test-time
|
2015-12-27 22:03:49 +08:00
|
|
|
|
|
|
|
# Check that the per test timeout is enforced when running GTest tests.
|
|
|
|
#
|
|
|
|
# RUN: not %{lit} -j 1 -v %{inputs}/googletest-timeout --timeout=1 > %t.cmd.out
|
|
|
|
# RUN: FileCheck < %t.cmd.out %s
|
|
|
|
|
|
|
|
# Check that the per test timeout is enforced when running GTest tests via
|
|
|
|
# the configuration file
|
|
|
|
#
|
|
|
|
# RUN: not %{lit} -j 1 -v %{inputs}/googletest-timeout \
|
|
|
|
# RUN: --param set_timeout=1 > %t.cfgset.out 2> %t.cfgset.err
|
|
|
|
# RUN: FileCheck < %t.cfgset.out %s
|
|
|
|
|
|
|
|
# CHECK: -- Testing:
|
2017-07-28 09:05:55 +08:00
|
|
|
# CHECK: PASS: googletest-timeout :: {{[Dd]ummy[Ss]ub[Dd]ir}}/OneTest.py/FirstTest.subTestA
|
|
|
|
# CHECK: TIMEOUT: googletest-timeout :: {{[Dd]ummy[Ss]ub[Dd]ir}}/OneTest.py/FirstTest.subTestB
|
|
|
|
# CHECK: TIMEOUT: googletest-timeout :: {{[Dd]ummy[Ss]ub[Dd]ir}}/OneTest.py/FirstTest.subTestC
|
2015-12-27 22:03:49 +08:00
|
|
|
# CHECK: Expected Passes : 1
|
|
|
|
# CHECK: Individual Timeouts: 2
|
|
|
|
|
|
|
|
# Test per test timeout via a config file and on the command line.
|
|
|
|
# The value set on the command line should override the config file.
|
|
|
|
# RUN: not %{lit} -j 1 -v %{inputs}/googletest-timeout \
|
|
|
|
# RUN: --param set_timeout=1 --timeout=2 > %t.cmdover.out 2> %t.cmdover.err
|
|
|
|
# RUN: FileCheck < %t.cmdover.out %s
|
|
|
|
# RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-ERR < %t.cmdover.err %s
|
|
|
|
|
|
|
|
# CHECK-CMDLINE-OVERRIDE-ERR: Forcing timeout to be 2 seconds
|