ctubbsii commented on code in PR #5145:
URL: https://github.com/apache/accumulo/pull/5145#discussion_r1874035233
##########
test/src/main/java/org/apache/accumulo/test/functional/HalfDeadServerWatcherIT.java:
##########
@@ -155,7 +161,14 @@ public void testTwo() throws Exception {
assertTrue(testTabletServerWithStuckWatcherDies());
} else {
// This test should time out
- assertThrows(IllegalStateException.class, () ->
testTabletServerWithStuckWatcherDies());
+ try {
+ testTabletServerWithStuckWatcherDies();
+ fail("Test did not time out.");
+ } catch (IllegalStateException e) {
+ if (!e.getMessage().contains("Timeout exceeded")) {
+ fail("Unexpected exception: " + e.getMessage());
+ }
Review Comment:
The original assertThrows was better. assertThrows returns the thrown
exception, so you can follow it with an asssertTrue for checking the message.
--
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]