Skip to content

Commit

Permalink
[FLINK-36191][tests] FsMergingCheckpointStorageLocationTest generates…
Browse files Browse the repository at this point in the history
… test data not in tmp folder
  • Loading branch information
snuyanzin authored Sep 4, 2024
1 parent 5d9a1c5 commit bf39391
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
import org.apache.flink.runtime.state.CheckpointedStateScope;
import org.apache.flink.runtime.state.filemerging.SegmentFileStateHandle;

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;
Expand All @@ -53,8 +53,8 @@
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;

Expand All @@ -74,9 +74,9 @@ public class FsMergingCheckpointStorageLocationTest {
new FileMergingSnapshotManager.SubtaskKey(
jobId.toHexString(), opId.toHexString(), 1, 1);

@Before
public void prepareDirectories() {
checkpointBaseDir = new Path(tmpFolder.toString());
@BeforeEach
void prepareDirectories() {
checkpointBaseDir = new Path(tmpFolder.getAbsolutePath());
sharedStateDir =
new Path(
checkpointBaseDir,
Expand All @@ -88,7 +88,7 @@ public void prepareDirectories() {
}

@Test
public void testWriteMultipleStateFilesWithinCheckpoint() throws Exception {
void testWriteMultipleStateFilesWithinCheckpoint() throws Exception {
testWriteMultipleStateFiles();
}

Expand Down Expand Up @@ -118,7 +118,7 @@ private void testWriteMultipleStateFiles() throws Exception {
}

@Test
public void testCheckpointStreamClosedExceptionally() throws Exception {
void testCheckpointStreamClosedExceptionally() throws Exception {
try (FileMergingSnapshotManager snapshotManager = createFileMergingSnapshotManager()) {
Path filePath1 = null;
try (FileMergingCheckpointStateOutputStream stream1 =
Expand All @@ -139,7 +139,7 @@ private void assertPathNotNullAndCheckExistence(Path path, boolean exist) throws
}

@Test
public void testWritingToClosedStream() {
void testWritingToClosedStream() {
FileMergingSnapshotManager snapshotManager = createFileMergingSnapshotManager();
FsMergingCheckpointStorageLocation storageLocation =
createFsMergingCheckpointStorageLocation(1, snapshotManager);
Expand All @@ -155,7 +155,7 @@ public void testWritingToClosedStream() {
}

@Test
public void testWriteAndReadPositionInformation() throws Exception {
void testWriteAndReadPositionInformation() throws Exception {
long maxFileSize = 128;
FileMergingSnapshotManager snapshotManager = createFileMergingSnapshotManager(maxFileSize);
FsMergingCheckpointStorageLocation storageLocation1 =
Expand Down

0 comments on commit bf39391

Please sign in to comment.