File tree Expand file tree Collapse file tree 3 files changed +25
-4
lines changed Expand file tree Collapse file tree 3 files changed +25
-4
lines changed Original file line number Diff line number Diff line change 11import lit.formats
22
33config.name = " timeout-hang"
4- config.suffixes = [" .py " ]
4+ config.suffixes = [" .txt " ]
55config.test_format = lit.formats.ShTest()
66config.test_source_root = None
77config.test_exec_root = None
File renamed without changes.
Original file line number Diff line number Diff line change 11# REQUIRES: lit-max-individual-test-time
22
3- # https://github.com/llvm/llvm-project/issues/133914
3+ # Python has some issues dealing with exceptions when multiprocessing,
4+ # which can cause hangs. Previously this could occur when we encountered
5+ # an internal shell exception, and had a timeout set.
46
5- # RUN: not %{lit} %{inputs}/timeout-hang/run-nonexistent.py \
6- # RUN: --timeout=1 --param external=0 -a
7+ # This test runs a lit test that tries to launch a non-existent file,
8+ # throwing an exception. We expect this to fail immediately, rather than
9+ # timeout.
10+
11+ # DEFINE: %{timeout}=1
12+
13+ # RUN: not %{lit} %{inputs}/timeout-hang/run-nonexistent.txt \
14+ # RUN: --timeout=%{timeout} --param external=0 | %{python} %s %{timeout}
15+
16+ import sys
17+ import re
18+
19+ timeout_time = float (sys .argv [1 ])
20+ testing_time = float (re .search (r'Testing Time: (.*)s' , sys .stdin .read ()).group (1 ))
21+
22+ if testing_time < timeout_time :
23+ print ("Testing took less than timeout" )
24+ sys .exit (0 )
25+ else :
26+ print ("Testing took as long or longer than timeout" )
27+ sys .exit (1 )
You can’t perform that action at this time.
0 commit comments