You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by sn...@apache.org on 2024/09/04 21:17:25 UTC
(flink) branch release-1.19 updated: [FLINK-36191][tests] FsMergingCheckpointStorageLocationTest generates test data not in tmp folder
This is an automated email from the ASF dual-hosted git repository.
snuyanzin pushed a commit to branch release-1.19
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.19 by this push:
new 194df6c4067 [FLINK-36191][tests] FsMergingCheckpointStorageLocationTest generates test data not in tmp folder
194df6c4067 is described below
commit 194df6c4067c1ee4712839afdf699e051d237c74
Author: Sergey Nuyanzin <sn...@gmail.com>
AuthorDate: Wed Sep 4 23:17:16 2024 +0200
[FLINK-36191][tests] FsMergingCheckpointStorageLocationTest generates test data not in tmp folder
---
.../FsMergingCheckpointStorageLocationTest.java | 26 +++++++++++-----------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/state/filesystem/FsMergingCheckpointStorageLocationTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/state/filesystem/FsMergingCheckpointStorageLocationTest.java
index 37fbaa98f09..0c20186463b 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/state/filesystem/FsMergingCheckpointStorageLocationTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/state/filesystem/FsMergingCheckpointStorageLocationTest.java
@@ -28,13 +28,13 @@ import org.apache.flink.runtime.checkpoint.filemerging.SegmentFileStateHandle;
import org.apache.flink.runtime.state.CheckpointStorageLocationReference;
import org.apache.flink.runtime.state.CheckpointedStateScope;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
import javax.annotation.Nonnull;
+import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
@@ -49,8 +49,8 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
/** Tests for {@link FsMergingCheckpointStorageLocation}. */
-public class FsMergingCheckpointStorageLocationTest {
- @Rule public final TemporaryFolder tmpFolder = new TemporaryFolder();
+class FsMergingCheckpointStorageLocationTest {
+ @TempDir File tmpFolder;
public static Path checkpointBaseDir;
@@ -66,9 +66,9 @@ public class FsMergingCheckpointStorageLocationTest {
private static final FileMergingSnapshotManager.SubtaskKey SUBTASK_KEY =
new FileMergingSnapshotManager.SubtaskKey("opId", 1, 1);
- @Before
- public void prepareDirectories() {
- checkpointBaseDir = new Path(tmpFolder.toString());
+ @BeforeEach
+ void prepareDirectories() {
+ checkpointBaseDir = new Path(tmpFolder.getAbsolutePath());
sharedStateDir =
new Path(
checkpointBaseDir,
@@ -80,7 +80,7 @@ public class FsMergingCheckpointStorageLocationTest {
}
@Test
- public void testWriteMultipleStateFilesWithinCheckpoint() throws Exception {
+ void testWriteMultipleStateFilesWithinCheckpoint() throws Exception {
testWriteMultipleStateFiles();
}
@@ -110,7 +110,7 @@ public class FsMergingCheckpointStorageLocationTest {
}
@Test
- public void testCheckpointStreamClosedExceptionally() throws Exception {
+ void testCheckpointStreamClosedExceptionally() throws Exception {
try (FileMergingSnapshotManager snapshotManager = createFileMergingSnapshotManager()) {
Path filePath1 = null;
try (FileMergingCheckpointStateOutputStream stream1 =
@@ -131,7 +131,7 @@ public class FsMergingCheckpointStorageLocationTest {
}
@Test
- public void testWritingToClosedStream() {
+ void testWritingToClosedStream() {
FileMergingSnapshotManager snapshotManager = createFileMergingSnapshotManager();
FsMergingCheckpointStorageLocation storageLocation =
createFsMergingCheckpointStorageLocation(1, snapshotManager);
@@ -147,7 +147,7 @@ public class FsMergingCheckpointStorageLocationTest {
}
@Test
- public void testWriteAndReadPositionInformation() throws Exception {
+ void testWriteAndReadPositionInformation() throws Exception {
long maxFileSize = 128;
FileMergingSnapshotManager snapshotManager = createFileMergingSnapshotManager(maxFileSize);
FsMergingCheckpointStorageLocation storageLocation1 =