ccaominh commented on a change in pull request #8458: Exit JVM on curator
unhandled errors
URL: https://github.com/apache/incubator-druid/pull/8458#discussion_r321034583
##########
File path: server/src/test/java/org/apache/druid/curator/CuratorModuleTest.java
##########
@@ -117,21 +129,73 @@ public void emptyExhibitorHosts()
);
}
+ @Test
+ public void exitsJvmWhenMaxRetriesExceeded() throws Exception
+ {
+ Properties props = new Properties();
+ props.setProperty(CURATOR_CONNECTION_TIMEOUT_MS_KEY, "0");
+ Injector injector = newInjector(props);
+ CuratorFramework curatorFramework = createCuratorFramework(injector, 0);
+ curatorFramework.start();
+
+ exit.expectSystemExitWithStatus(1);
+ logger.clearLogEvents();
+
+ // This will result in a curator unhandled error since the connection
timeout is 0 and retries are disabled
+ curatorFramework.create().inBackground().forPath("/foo");
+
+ // org.apache.curator.framework.impl.CuratorFrameworkImpl logs "Background
retry gave up" unhandled error twice
+ List<LogEvent> loggingEvents = logger.getLogEvents();
+ Assert.assertFalse(loggingEvents.isEmpty());
+ LogEvent logEvent = loggingEvents.get(0);
+ Assert.assertEquals(Level.ERROR, logEvent.getLevel());
+ Assert.assertEquals("Unhandled error in Curator Framework",
logEvent.getMessage().getFormattedMessage());
+ }
+
+ @Test
+ public void ignoresDeprecatedCuratorConfigProperties()
Review comment:
I've added an @Ignore with an explanation
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]