[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 08:44:24 PST 2015
delcypher added inline comments.
================
Comment at: utils/lit/tests/Inputs/per_test_timeout/slow.py:8
@@ +7,2 @@
+print("slow program")
+time.sleep(6)
----------------
jroelofs wrote:
> The infinite loop testcase was actually useful to guarantee that the timeout detection & handling code isn't broken. With this testcase, it could be broken and we wouldn't notice (apart from the tests running a little slower).
If the ``slow.py`` program doesn't cause a timeout then several tests will fail. If you replace ``time.sleep(6)`` with ``time.sleep(0)`` then run lit on the test cases you will see failures.
```
python2 ~/dev/llvm-upstream/src/utils/lit/lit.py -v --debug tests/Inputs/per_test_timeout/
********************
Testing Time: 0.41s
********************
Failing Tests (3):
per_test_timeout :: timeout_external.txt
per_test_timeout :: timeout_internal.txt
per_test_timeout :: timeout_internal_set_in_config.txt
Expected Passes : 2
Unexpected Failures: 3
```
What you had before (an infinite loop and an ``XFAIL`` line) was not helpful because running the above command would **always** hang. One work around if you really want a test case with an infinite loop is to do some trickery with ``lit.cfg`` so that when we invoke it from the command line ``slow.py`` doesn't get detected but when we run lit inside lit it is detected.
http://reviews.llvm.org/D14706
More information about the llvm-commits
mailing list