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
Fix disengage failure logs for FatalConditionHandlerGuard #2376
Conversation
May break the logic in case of WinAPI changes with no warnings Signed-off-by: Kochetkov, Yuriy <yuriyx.kochetkov@intel.com>
FatalConditionHandlerGuard is used within RunContext::invokeActiveTestCase(). The intent of this guard is to avoid binary crash without failed test being reported. Still in case FatalConditionHandlerGuard destructor being called during stack unwinding AND finds unexpected top-level filter for SEH unhandled exception, the binary may still crash. As result of such crash the original exception details are being hidden. As the Catch2 provides only `CATCH_CATCH_ANON` macro, with no access to exception details by design, looks like the best way to handle issue is to: - state requirements explicitly by `noexcept` specifier - use `Catch::cerr()` to print out possible issue notification Signed-off-by: Kochetkov, Yuriy <yuriyx.kochetkov@intel.com>
Codecov Report
@@ Coverage Diff @@
## devel #2376 +/- ##
==========================================
+ Coverage 91.04% 91.06% +0.01%
==========================================
Files 152 152
Lines 7313 7313
==========================================
+ Hits 6658 6659 +1
+ Misses 655 654 -1 |
Signed-off-by: Kochetkov, Yuriy <yuriyx.kochetkov@intel.com>
I've tried to align tests with the ones added by #2334. Please let me know if anything else should be done. |
|
Basically, v3 also uses As for example, let's say we have the following code somewhere in product or 3rd-party dependencies:
Now let's assume we use Catch2 to test such code:
The test would result in |
@horenmar Am I missing something? Please feel free to provide any concerns you have |
@yuriykoch Just the usual, not enough time. Anyway, after reading this again I have no objections. For some reason I was reading the changes as against the v2, where failing to remove Catch2's handler meant something was seriously wrong, because the VEH handlers form a list, and it would mean that our handler somehow disappeared from the list. With the changes to v3, there are indeed situations where the check can fail and shouldn't kill the process. |
Description
FatalConditionHandlerGuard
is used withinRunContext::invokeActiveTestCase()
.The intent of this guard is to avoid binary crash without failed test being
reported.
Still in case FatalConditionHandlerGuard destructor being called during stack
unwinding AND finds unexpected top-level filter for SEH unhandled exception,
the binary may still crash. As result of such crash the original exception
details are being hidden.
As the Catch2 provides only
CATCH_CATCH_ANON
macro, with no access toexception details by design, looks like the best way to handle issue is to:
noexcept
specifierCatch::cerr()
to print out possible issue notification