reswqa commented on code in PR #22632:
URL: https://github.com/apache/flink/pull/22632#discussion_r1204542727
##########
flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/runner/ZooKeeperDefaultDispatcherRunnerTest.java:
##########
@@ -153,15 +154,17 @@ void testResourceCleanupUnderLeadershipChange() throws
Exception {
final TestingLeaderElectionService dispatcherLeaderElectionService =
new TestingLeaderElectionService();
- final CuratorFramework client =
- ZooKeeperUtils.startCuratorFramework(configuration,
fatalErrorHandler)
- .asCuratorFramework();
- try (final TestingHighAvailabilityServices highAvailabilityServices =
- new TestingHighAvailabilityServicesBuilder()
-
.setDispatcherLeaderElectionService(dispatcherLeaderElectionService)
- .setJobMasterLeaderRetrieverFunction(
- jobId ->
ZooKeeperUtils.createLeaderRetrievalService(client))
- .build()) {
+ try (final CuratorFrameworkWithUnhandledErrorListener
curatorFrameworkWrapper =
+ ZooKeeperUtils.startCuratorFramework(configuration,
fatalErrorHandler);
Review Comment:
The following way is not used here as it will pop up a warning:
`CuratorFrameworkWithUnhandledErrorListener used without 'try'-with-resources
statement`.
```
try (CuratorFramework curatorFramework =
ZooKeeperUtils.startCuratorFramework(configuration,
fatalErrorHandler)
.asCuratorFramework();
```
--
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]