diff --git a/server/src/test/java/org/apache/druid/curator/CuratorModuleTest.java b/server/src/test/java/org/apache/druid/curator/CuratorModuleTest.java index d17d76c99a2..b0997b873b1 100644 --- a/server/src/test/java/org/apache/druid/curator/CuratorModuleTest.java +++ b/server/src/test/java/org/apache/druid/curator/CuratorModuleTest.java @@ -147,11 +147,16 @@ public final class CuratorModuleTest // org.apache.curator.framework.impl.CuratorFrameworkImpl logs "Background retry gave up" unhandled error twice List loggingEvents = logger.getLogEvents(); - Assert.assertFalse(loggingEvents.isEmpty()); - LogEvent logEvent = loggingEvents.get(0); - String message = "Logging events: " + loggingEvents; - Assert.assertEquals(message, Level.ERROR, logEvent.getLevel()); - Assert.assertEquals(message, "Unhandled error in Curator Framework", logEvent.getMessage().getFormattedMessage()); + Assert.assertTrue( + "Logging events: " + loggingEvents, + loggingEvents.stream() + .anyMatch(l -> + l.getLevel().equals(Level.ERROR) + && l.getMessage() + .getFormattedMessage() + .equals("Unhandled error in Curator Framework") + ) + ); } @Ignore("Verifies changes in https://github.com/apache/incubator-druid/pull/8458, but overkill for regular testing")