[llvm] [test] Align behavior of interrupts.test on different platforms (PR #68556)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 19 00:50:00 PDT 2023


https://github.com/jh7370 requested changes to this pull request.

I'm not convinced the original test is correct and this commit actually makes the test worse, I think:

The test is intended to fail if llvm-symbolizer produces any stderr output on a Ctrl-Break/SIGINT. The test should therefore fail if any stderr was produced at all, including the missing binary file error message. If with your change llvm-symbolizer is producing stderr output, and the Linux test is NOT failing, that seems like a bug in the test? Conversely, if the Windows one started failing, prior to your change, I think it's working as intended (albeit picking up the "wrong" stderr).

I think the test fix that is needed is twofold:
1) The Linux stderr output needs propagating up to the lit runner so that the test fails if llvm-symbolizer produces any stderr, as intended.
2) The stdin writing needs to be such that it won't cause llvm-symbolizer to produce an error (I don't have a concrete suggestion as to what that might be). If this requires a real input, it would be better to create a minimal object file at test time, rather than try to refer to a canned object elsewhere in the testsuite, to allow this test to be self-contained.

NB: I don't think we can simply check for a specific stderr output, instead of checking that there was none, because that would introduce a race condition: llvm-symbolizer might not have written the expected message before receiving the interrupt signal. It might even have written part of the message when being interrupted.




https://github.com/llvm/llvm-project/pull/68556


More information about the llvm-commits mailing list