clintropolis commented on a change in pull request #8458: Exit JVM on curator 
unhandled errors
URL: https://github.com/apache/incubator-druid/pull/8458#discussion_r321001349
 
 

 ##########
 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 think this test should be marked `@Ignore` or removed since it seems like 
useful to help prove that the old config that has been removed doesn't 
interfere with the changes in this PR, but beyond that seems to have very 
little utility because this won't catch any sort of future regression and 
doesn't really worth spending the CPU cycles on as part of day to day CI.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to