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/10/30 16:15:20 UTC

(flink) branch master updated: [FLINK-36606][tests] TimestampITCase generates test artifacts outside of tmp folder

This is an automated email from the ASF dual-hosted git repository.

snuyanzin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new ec8d6792e84 [FLINK-36606][tests] TimestampITCase generates test artifacts outside of tmp folder
ec8d6792e84 is described below

commit ec8d6792e84699a3fe60dddc7d7c1dab5fdb2786
Author: Sergey Nuyanzin <sn...@gmail.com>
AuthorDate: Wed Oct 30 17:15:13 2024 +0100

    [FLINK-36606][tests] TimestampITCase generates test artifacts outside of tmp folder
---
 .../org/apache/flink/test/streaming/runtime/TimestampITCase.java  | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/flink-tests/src/test/java/org/apache/flink/test/streaming/runtime/TimestampITCase.java b/flink-tests/src/test/java/org/apache/flink/test/streaming/runtime/TimestampITCase.java
index 14238407b46..a1c7295f318 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/streaming/runtime/TimestampITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/streaming/runtime/TimestampITCase.java
@@ -60,7 +60,9 @@ import org.apache.flink.util.function.SerializableFunction;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.ClassRule;
+import org.junit.Rule;
 import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
 
 import java.time.Duration;
 import java.util.ArrayList;
@@ -78,6 +80,8 @@ import static org.junit.Assert.fail;
 @SuppressWarnings("serial")
 public class TimestampITCase extends TestLogger {
 
+    @Rule public TemporaryFolder tmpFolder = new TemporaryFolder();
+
     private static final int NUM_TASK_MANAGERS = 2;
     private static final int NUM_TASK_SLOTS = 3;
     private static final int PARALLELISM = NUM_TASK_MANAGERS * NUM_TASK_SLOTS;
@@ -227,14 +231,16 @@ public class TimestampITCase extends TestLogger {
                             JobID id = running.get(0);
 
                             waitUntilAllTasksAreRunning(CLUSTER.getRestClusterClient(), id);
+
                             // send stop until the job is stopped
+                            final String savepointDirName = tmpFolder.newFolder().getAbsolutePath();
                             do {
                                 try {
                                     clusterClient
                                             .stopWithSavepoint(
                                                     id,
                                                     false,
-                                                    "test",
+                                                    savepointDirName,
                                                     SavepointFormatType.CANONICAL)
                                             .get();
                                 } catch (Exception e) {