You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2022/02/08 14:16:53 UTC

[GitHub] [accumulo] DomGarguilo edited a comment on pull request #2472: Convert try-catch to assertThrows

DomGarguilo edited a comment on pull request #2472:
URL: https://github.com/apache/accumulo/pull/2472#issuecomment-1032094797


   The call to recover() doesn’t throw any error. I forgot to mention that.
   
   On Mon, Feb 7, 2022 at 7:41 PM Christopher Tubbs ***@***.***>
   wrote:
   
   > 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.
   >
   > —
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/accumulo/pull/2472#issuecomment-1032093257>,
   > or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/ALMD2IIZ3PUPUEIAIMYRTPTU2BREZANCNFSM5NYV4DBA>
   > .
   > Triage notifications on the go with GitHub Mobile for iOS
   > <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
   > or Android
   > <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
   >
   > You are receiving this because you authored the thread.Message ID:
   > ***@***.***>
   >
   


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org