snuyanzin commented on code in PR #22632:
URL: https://github.com/apache/flink/pull/22632#discussion_r1204204907
##########
flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/ZooKeeperCompletedCheckpointStoreTest.java:
##########
@@ -54,32 +53,34 @@
import static java.util.Collections.emptyList;
import static
org.apache.flink.runtime.checkpoint.CheckpointRetentionPolicy.NEVER_RETAIN_AFTER_TERMINATION;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThrows;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
/** Tests for {@link DefaultCompletedCheckpointStore} with {@link
ZooKeeperStateHandleStore}. */
-public class ZooKeeperCompletedCheckpointStoreTest extends TestLogger {
+class ZooKeeperCompletedCheckpointStoreTest {
- @ClassRule public static ZooKeeperResource zooKeeperResource = new
ZooKeeperResource();
+ @RegisterExtension
+ public static AllCallbackWrapper<ZooKeeperExtension>
zooKeeperExtensionWrapper =
+ new AllCallbackWrapper<>(new ZooKeeperExtension());
private static final ZooKeeperCheckpointStoreUtil
zooKeeperCheckpointStoreUtil =
ZooKeeperCheckpointStoreUtil.INSTANCE;
@Test
- public void testPathConversion() {
+ void testPathConversion() {
final long checkpointId = 42L;
final String path =
zooKeeperCheckpointStoreUtil.checkpointIDToName(checkpointId);
- assertEquals(checkpointId,
zooKeeperCheckpointStoreUtil.nameToCheckpointID(path));
+
assertThat(zooKeeperCheckpointStoreUtil.nameToCheckpointID(path)).isEqualTo(checkpointId);
}
@Test
- public void testRecoverFailsIfDownloadFails() {
+ void testRecoverFailsIfDownloadFails() {
final Configuration configuration = new Configuration();
configuration.setString(
- HighAvailabilityOptions.HA_ZOOKEEPER_QUORUM,
zooKeeperResource.getConnectString());
+ HighAvailabilityOptions.HA_ZOOKEEPER_QUORUM,
+
zooKeeperExtensionWrapper.getCustomExtension().getConnectString());
final List<Tuple2<RetrievableStateHandle<CompletedCheckpoint>,
String>> checkpointsInZk =
new ArrayList<>();
final ZooKeeperStateHandleStore<CompletedCheckpoint>
checkpointsInZooKeeper =
Review Comment:
it seems here `ZooKeeperUtils.startCuratorFramework` opens resources and
doesn't close it.. May be put it in `try` resources block
--
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]