ctubbsii commented on pull request #2472: URL: https://github.com/apache/accumulo/pull/2472#issuecomment-1032093257
> It looks like the test is expecting the the call to `recover()` to fail and if it doesn't, the test will fail via the call to `fail()`. But in this case, the `fail()` statement will be caught as a `Throwable` and **not** cause the test to fail when reached, Functionally, the whole try catch block does nothing more than call `recover()`. I'm not certain im interpreting this correctly but if I am, I'm not sure how to handle this case. Yeah, ErrorProne is correct. `fail()`, like all the JUnit assertions, triggers an `AssertionError` that is caught and reported. We shouldn't be catching `Throwable` here, because it will also catch and ignore that `AssertionError`. We should only catch `Exception`, at most. We need to figure out which exception is expected, and use `assertThrows` with that directly like you've done with the others. -- 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]
