[PATCH] D14706: [lit] Implement support of per test timeout in lit.

Dan Liew via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 16 07:53:52 PST 2015


delcypher created this revision.
delcypher added reviewers: ddunbar, jroelofs, cmatthews.
delcypher added a subscriber: llvm-commits.

[lit] Implement support of per test timeout in lit.

This should work with ShTest (executed externally or internally) and GTest
test formats.

To set the timeout a new option ``--max-individual-test-time=`` has
been added which specifies the maximum run time of an individual test
in seconds. By default this 0 which causes no timeout to be enforced.

The timeout can also be set from a lit configuration file by modifying
the ``lit_config.maxIndividualTestTime`` property.

To implement a timeout we now require the psutil Python module if a
timeout is requested. This dependency is confined to the newly added
``lit.util.killProcessAndChildren()`` function so that in the future
we can remove the dependency if needed.

To avoid breaking the existing behaviour the psutil module will not be
imported if no timeout is requested.

The included testcases are derived from test cases provided by
Jonathan Roelofs. These test cases aren't really complete (GTest
format isn't being tested) but it will do for now.



http://reviews.llvm.org/D14706

Files:
  utils/lit/lit/LitConfig.py
  utils/lit/lit/Test.py
  utils/lit/lit/TestRunner.py
  utils/lit/lit/formats/googletest.py
  utils/lit/lit/main.py
  utils/lit/lit/util.py
  utils/lit/tests/Inputs/per_test_timeout/lit.cfg
  utils/lit/tests/Inputs/per_test_timeout/short.py
  utils/lit/tests/Inputs/per_test_timeout/slow.py
  utils/lit/tests/Inputs/per_test_timeout/timeout_external.txt
  utils/lit/tests/Inputs/per_test_timeout/timeout_internal.txt
  utils/lit/tests/Inputs/per_test_timeout/timeout_internal_set_in_config.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14706.40289.patch
Type: text/x-patch
Size: 22198 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151116/adca6b92/attachment-0001.bin>


More information about the llvm-commits mailing list