eolivelli commented on code in PR #419:
URL: https://github.com/apache/curator/pull/419#discussion_r897876484
##########
curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java:
##########
@@ -1151,4 +1151,45 @@ public void invoke() throws Exception
TestCleanState.closeAndTestClean(client);
}
}
+
+ @Test
+ public void testIsolatedThreadGroup() throws Exception {
+ AtomicReference<Throwable> exception = new AtomicReference<>();
+
+ CuratorFramework client =
CuratorFrameworkFactory.newClient(server.getConnectString(), 30000, 30000, new
RetryOneTime(1));
+ client.getUnhandledErrorListenable().addListener((message, e) ->
exception.set(e));
+ client.start();
+
+ ThreadGroup threadGroup1 = new ThreadGroup("testGroup1");
+ Thread thread1 = new Thread(threadGroup1, () -> {
+ try ( final PathChildrenCache cache = new
PathChildrenCache(client, "/test1", true) ) {
+ cache.start();
+ Thread.sleep(1000);
+ } catch (Exception e) {
+ exception.set(e);
+ }
+ });
+
+ thread1.start();
+ thread1.join();
+ assertNull(exception.get());
Review Comment:
nit: I suggest to use CompletableFuture, not a big deal in any case
--
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]