brbzull0 opened a new pull request, #13906:
URL: https://github.com/apache/trafficserver/pull/13906

   `~ScopedMethodHandler()`, added in #13649, is `noexcept`. It checks the 
handler's removal with `CHECK` and reports an exception from that block with 
`FAIL_CHECK`. When Catch2 aborts the run (`--abort`, or `-x N` once N 
assertions have failed), a failing `CHECK` or `FAIL_CHECK` records the failure 
and then throws `Catch::TestFailureException`. That throw lands in the 
destructor's `catch (...)`, whose `FAIL_CHECK` throws again, out of the 
`noexcept` destructor, and the test binary ends in `std::terminate`. ctest runs 
these cases without `--abort`, so CI does not take this path; running 
`test_jsonrpcserver` by hand with `--abort` does.
   
   Coverity CIDs: 
[1687014](https://scan6.scan.coverity.com/#/project-view/58063/10191?selectedIssue=1687014),
 
[1687015](https://scan6.scan.coverity.com/#/project-view/58063/10191?selectedIssue=1687015)
   
   **What changes:**
   
   - The destructor's `catch (...)` no longer asserts. Catch2's abort is what 
reaches it, after `CHECK` has recorded the failure; `CHECK` catches what 
`test_remove_handler` throws itself.
   - The `FAIL_CHECK` in the `catch (std::exception const &)` handler, which 
runs when `INFO` or Catch2 throws, sits in its own `try`/`catch (...)`.
   - A hidden case, `[.][guard_abort]`, makes the guard's removal fail on 
purpose. A new ctest entry, `test_jsonrpcserver.guard_abort`, runs it with 
`--abort`. It passes on the guard's failure report followed by Catch2's 
summary, and fails on Catch2's "fatal error condition" report, which Catch2 
prints when `std::terminate` ends the binary. With the previous destructor the 
entry fails. The case skips unless `RPC_TEST_GUARD_ABORT` is set and Catch2 
aborts after one failure, so a `"*"` run does not fail on it.
   
   **What this PR does not do:**
   
   - CID 1687015 names `Catch::TestSkipException`. `FAIL_CHECK` does not raise 
it (Catch2 sets the skip reaction for `SKIP()`), so that report is addressed by 
the same change, not a separate one.
   - The `std::exception` handler has no test: it runs when `INFO` or Catch2 
fails, for example on allocation failure.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to