-
-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't swallow gtest failures when running tests in LLDB #4552
Conversation
This should fail CI as there is a test failure that currently isn't being caught. Once we verify that it is correctly failing, we can rebase against |
@SeanTAllen i would assume we only want |
@dipinhora will this result in an early test suite exit? if no, then, does it matter if it isn't scoped to LLDB? |
i believe it would be an early test exit since it would be an unhandled c++ exception for every failure but i'm not 100% sure.. in theory this should be a quick thing to confirm since we have a reproducible failure.. |
@dipinhora i'll test now. |
@SeanTAllen yep, seems like an early exit/abort when
|
In CI, we run our various tests in LLDB as a debugger. LLDB when run in batch mode like we are doing, always returns 0 as the exit code. It doesn't return the exit code from the program being run. The LLDB documentation states this is because more than 1 process can be being debugged so the concept that GDB has for returning the error code is more problematic with LLDB. The result of this is that non-exception errors in CI are not being flagged because LLDB is eating the exit code from gtest when a test fails. gest offers the `--gtest_throw_on_failure` option that turns test failures into exceptions. Those exceptions will be caught when we are using LLDB and reported correctly in CI. Long term, we have discussed adding an LLDB module with python to get us the "return exit code". There is discussion on Stack Overflow of this approach at https://stackoverflow.com/questions/56456724/quit-lldb-with-exit-code-of-process/76741573#76741573
e16e2d1
to
2865574
Compare
I verified when doing this that full program tests correctly fail when run under lldb. |
@dipinhora updated |
#4553 has been opened to fix the failing test.. |
In CI, we run our various tests in LLDB as a debugger. LLDB when run in batch mode like we are doing, always returns 0 as the exit code. It doesn't return the exit code from the program being run. The LLDB documentation states this is because more than 1 process can be being debugged so the concept that GDB has for returning the error code is more problematic with LLDB.
The result of this is that non-exception errors in CI are not being flagged because LLDB is eating the exit code from gtest when a test fails. gest offers the
--gtest_throw_on_failure
option that turns test failures into exceptions.Those exceptions will be caught when we are using LLDB and reported correctly in CI.
Long term, we have discussed adding an LLDB module with python to get us the "return exit code". There is discussion on Stack Overflow of this approach at https://stackoverflow.com/questions/56456724/quit-lldb-with-exit-code-of-process/76741573#76741573