Commit e8d1e30
authored
[LIT][E2E] Fix LIT hang when executing non-existent files (#17505)
Fixes #16351
In our containers if an exception is not immediately caught lit will
hang on the following call
https://github.com/intel/llvm/blob/4adaef0e444cf9a7e11f433b9995ece6bf9e0aa4/llvm/utils/lit/lit/run.py#L93
This can occur when using the internal lit shell and trying to run a
program that does not exist. In this case `_executeShCmd` will throw an
internal shell error, which will not be caught by the function directly
calling it, `executeShCmd`, rather it is caught one function higher in
the call stack in `executeScriptInternal`. Because that exception is
percolated up the call stack instead of being immediately caught lit
will hang. This patch changes the location where we catch this exception
to `executeShCmd` instead to avoid this.
Previously to avoid this we would use the external lit shell. However
this introduces some differences in how we need to write tests (i.e.,
needing to add `--crash` for certain `not` calls), it slightly changes
how test output is printed (all in one block, rather than separated by
`RUN:` lines), and it messes up the path to executables when running on
Windows (all `\` were interpreted as escapes for the next characters
leading to trying to execute a non-existent file). This pr also changes
the E2E tests to always use the internal lit shell.
For more background on what causes this hang see:
https://stackoverflow.com/questions/15314189/python-multiprocessing-pool-hangs-at-join
https://bugs.python.org/issue9400
python/cpython#536461 parent 34c7c60 commit e8d1e30
File tree
5 files changed
+48
-16
lines changed- llvm/utils/lit
- lit
- tests
- Inputs/timeout-hang
- sycl/test-e2e
5 files changed
+48
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
205 | 212 | | |
206 | 213 | | |
207 | 214 | | |
| |||
1105 | 1112 | | |
1106 | 1113 | | |
1107 | 1114 | | |
1108 | | - | |
1109 | | - | |
1110 | | - | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
1115 | | - | |
1116 | | - | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
1117 | 1119 | | |
1118 | 1120 | | |
1119 | 1121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
378 | | - | |
379 | 377 | | |
380 | 378 | | |
381 | | - | |
382 | 379 | | |
383 | | - | |
384 | | - | |
385 | | - | |
| 380 | + | |
386 | 381 | | |
387 | 382 | | |
388 | 383 | | |
| |||
0 commit comments