You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by dw...@apache.org on 2021/04/16 16:48:37 UTC

[flink] branch master updated (de069df -> 79eb5c7)

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

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


    from de069df  [hotfix][docs] Fix config doc structure
     new 3ebf940  [FLINK-22249][tests] Add `FAILLING` to an assertion in JobMasterStopWithSavepointITCase
     new 25fa42d  [FLINK-22248][tests] Remove timeouts from JobMasterStopWithSavepointITCase
     new 68512cc  [hotfix][tests] Cancel all running jobs after each test in AbstractTestBase
     new 22e9357  [FLINK-22248][tests] Improve JobMasterStopWithSavepoint#waitForJob to wait for all tasks running
     new 79eb5c7  Revert "[FLINK-22249][FLINK-22248] Temporarily disable JobMasterStopWithSavepointITCase"

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/flink/test/util/AbstractTestBase.java   | 15 ++++++++
 .../JobMasterStopWithSavepointITCase.java          | 44 ++++++++++------------
 2 files changed, 35 insertions(+), 24 deletions(-)

[flink] 03/05: [hotfix][tests] Cancel all running jobs after each test in AbstractTestBase

Posted by dw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 68512cc2cdc427a04659f3d243a2309416ba5eb7
Author: Dawid Wysakowicz <dw...@apache.org>
AuthorDate: Thu Apr 15 11:45:20 2021 +0200

    [hotfix][tests] Cancel all running jobs after each test in AbstractTestBase
---
 .../java/org/apache/flink/test/util/AbstractTestBase.java | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/flink-test-utils-parent/flink-test-utils/src/main/java/org/apache/flink/test/util/AbstractTestBase.java b/flink-test-utils-parent/flink-test-utils/src/main/java/org/apache/flink/test/util/AbstractTestBase.java
index dc66f22..6695bc9 100644
--- a/flink-test-utils-parent/flink-test-utils/src/main/java/org/apache/flink/test/util/AbstractTestBase.java
+++ b/flink-test-utils-parent/flink-test-utils/src/main/java/org/apache/flink/test/util/AbstractTestBase.java
@@ -18,9 +18,11 @@
 
 package org.apache.flink.test.util;
 
+import org.apache.flink.runtime.client.JobStatusMessage;
 import org.apache.flink.runtime.testutils.MiniClusterResourceConfiguration;
 import org.apache.flink.util.FileUtils;
 
+import org.junit.After;
 import org.junit.ClassRule;
 import org.junit.rules.TemporaryFolder;
 
@@ -66,6 +68,19 @@ public abstract class AbstractTestBase extends TestBaseUtils {
 
     @ClassRule public static final TemporaryFolder TEMPORARY_FOLDER = new TemporaryFolder();
 
+    @After
+    public final void cleanupRunningJobs() throws Exception {
+        for (JobStatusMessage path : miniClusterResource.getClusterClient().listJobs().get()) {
+            if (!path.getJobState().isTerminalState()) {
+                try {
+                    miniClusterResource.getClusterClient().cancel(path.getJobId()).get();
+                } catch (Exception ignored) {
+                    // ignore exceptions when cancelling dangling jobs
+                }
+            }
+        }
+    }
+
     // --------------------------------------------------------------------------------------------
     //  Temporary File Utilities
     // --------------------------------------------------------------------------------------------

[flink] 01/05: [FLINK-22249][tests] Add `FAILLING` to an assertion in JobMasterStopWithSavepointITCase

Posted by dw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 3ebf94051ea234b4bec41b36e802f6cbcf18521d
Author: Dawid Wysakowicz <dw...@apache.org>
AuthorDate: Tue Apr 13 09:35:01 2021 +0200

    [FLINK-22249][tests] Add `FAILLING` to an assertion in JobMasterStopWithSavepointITCase
---
 .../flink/runtime/jobmaster/JobMasterStopWithSavepointITCase.java      | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterStopWithSavepointITCase.java b/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterStopWithSavepointITCase.java
index ad92ee5..47891aa 100644
--- a/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterStopWithSavepointITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterStopWithSavepointITCase.java
@@ -154,7 +154,8 @@ public class JobMasterStopWithSavepointITCase extends AbstractTestBase {
 
         // verifying that we actually received a synchronous checkpoint
         assertTrue(syncSavepointId.get() > 0);
-        assertThat(getJobStatus(), equalTo(JobStatus.FAILED));
+        assertThat(
+                getJobStatus(), either(equalTo(JobStatus.FAILED)).or(equalTo(JobStatus.FAILING)));
     }
 
     @Test(timeout = 5000)

[flink] 02/05: [FLINK-22248][tests] Remove timeouts from JobMasterStopWithSavepointITCase

Posted by dw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 25fa42df3dd0c6d2eada49c7c85619931846c678
Author: Dawid Wysakowicz <dw...@apache.org>
AuthorDate: Tue Apr 13 09:47:34 2021 +0200

    [FLINK-22248][tests] Remove timeouts from JobMasterStopWithSavepointITCase
---
 .../jobmaster/JobMasterStopWithSavepointITCase.java        | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterStopWithSavepointITCase.java b/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterStopWithSavepointITCase.java
index 47891aa..6eec106 100644
--- a/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterStopWithSavepointITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterStopWithSavepointITCase.java
@@ -99,13 +99,13 @@ public class JobMasterStopWithSavepointITCase extends AbstractTestBase {
 
     private JobGraph jobGraph;
 
-    @Test(timeout = 5000)
+    @Test
     public void suspendWithSavepointWithoutComplicationsShouldSucceedAndLeadJobToFinished()
             throws Exception {
         stopWithSavepointNormalExecutionHelper(false);
     }
 
-    @Test(timeout = 5000)
+    @Test
     public void terminateWithSavepointWithoutComplicationsShouldSucceedAndLeadJobToFinished()
             throws Exception {
         stopWithSavepointNormalExecutionHelper(true);
@@ -130,12 +130,12 @@ public class JobMasterStopWithSavepointITCase extends AbstractTestBase {
         assertThat(savepoints, hasItem(Paths.get(savepointLocation).getFileName()));
     }
 
-    @Test(timeout = 5000)
+    @Test
     public void throwingExceptionOnCallbackWithNoRestartsShouldFailTheSuspend() throws Exception {
         throwingExceptionOnCallbackWithoutRestartsHelper(false);
     }
 
-    @Test(timeout = 5000)
+    @Test
     public void throwingExceptionOnCallbackWithNoRestartsShouldFailTheTerminate() throws Exception {
         throwingExceptionOnCallbackWithoutRestartsHelper(true);
     }
@@ -158,13 +158,13 @@ public class JobMasterStopWithSavepointITCase extends AbstractTestBase {
                 getJobStatus(), either(equalTo(JobStatus.FAILED)).or(equalTo(JobStatus.FAILING)));
     }
 
-    @Test(timeout = 5000)
+    @Test
     public void throwingExceptionOnCallbackWithRestartsShouldSimplyRestartInSuspend()
             throws Exception {
         throwingExceptionOnCallbackWithRestartsHelper(false);
     }
 
-    @Test(timeout = 5000)
+    @Test
     public void throwingExceptionOnCallbackWithRestartsShouldSimplyRestartInTerminate()
             throws Exception {
         throwingExceptionOnCallbackWithRestartsHelper(true);
@@ -210,7 +210,7 @@ public class JobMasterStopWithSavepointITCase extends AbstractTestBase {
                 either(equalTo(JobStatus.CANCELLING)).or(equalTo(JobStatus.CANCELED)));
     }
 
-    @Test(timeout = 5000)
+    @Test
     public void testRestartCheckpointCoordinatorIfStopWithSavepointFails() throws Exception {
         setUpJobGraph(CheckpointCountingTask.class, RestartStrategies.noRestart());
 

[flink] 04/05: [FLINK-22248][tests] Improve JobMasterStopWithSavepoint#waitForJob to wait for all tasks running

Posted by dw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 22e9357d40f7f56fcb671e1076d8d7271316fcdf
Author: Dawid Wysakowicz <dw...@apache.org>
AuthorDate: Thu Apr 15 11:56:23 2021 +0200

    [FLINK-22248][tests] Improve JobMasterStopWithSavepoint#waitForJob to wait for all tasks running
---
 .../JobMasterStopWithSavepointITCase.java          | 25 ++++++++++------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterStopWithSavepointITCase.java b/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterStopWithSavepointITCase.java
index 6eec106..d4740992 100644
--- a/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterStopWithSavepointITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterStopWithSavepointITCase.java
@@ -19,6 +19,7 @@
 package org.apache.flink.runtime.jobmaster;
 
 import org.apache.flink.api.common.ExecutionConfig;
+import org.apache.flink.api.common.JobID;
 import org.apache.flink.api.common.JobStatus;
 import org.apache.flink.api.common.restartstrategy.RestartStrategies;
 import org.apache.flink.api.common.time.Deadline;
@@ -38,6 +39,7 @@ import org.apache.flink.runtime.jobgraph.JobVertex;
 import org.apache.flink.runtime.jobgraph.tasks.AbstractInvokable;
 import org.apache.flink.runtime.jobgraph.tasks.CheckpointCoordinatorConfiguration;
 import org.apache.flink.runtime.jobgraph.tasks.JobCheckpointingSettings;
+import org.apache.flink.runtime.testutils.CommonTestUtils;
 import org.apache.flink.streaming.runtime.tasks.StreamTask;
 import org.apache.flink.streaming.runtime.tasks.StreamTaskTest.NoOpStreamTask;
 import org.apache.flink.streaming.runtime.tasks.mailbox.MailboxDefaultAction;
@@ -313,20 +315,15 @@ public class JobMasterStopWithSavepointITCase extends AbstractTestBase {
     }
 
     private void waitForJob() throws Exception {
-        for (int i = 0; i < 60; i++) {
-            try {
-                final JobStatus jobStatus =
-                        clusterClient.getJobStatus(jobGraph.getJobID()).get(60, TimeUnit.SECONDS);
-                assertThat(jobStatus.isGloballyTerminalState(), equalTo(false));
-                if (jobStatus == JobStatus.RUNNING) {
-                    return;
-                }
-            } catch (ExecutionException ignored) {
-                // JobManagerRunner is not yet registered in Dispatcher
-            }
-            Thread.sleep(1000);
-        }
-        throw new AssertionError("Job did not become running within timeout.");
+        Deadline deadline = Deadline.fromNow(Duration.ofMinutes(5));
+        JobID jobID = jobGraph.getJobID();
+        CommonTestUtils.waitForAllTaskRunning(
+                () ->
+                        miniClusterResource
+                                .getMiniCluster()
+                                .getExecutionGraph(jobID)
+                                .get(60, TimeUnit.SECONDS),
+                deadline);
     }
 
     /**

[flink] 05/05: Revert "[FLINK-22249][FLINK-22248] Temporarily disable JobMasterStopWithSavepointITCase"

Posted by dw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 79eb5c79fd7f3b0b7518f70b7cb02c69e773aada
Author: Dawid Wysakowicz <dw...@apache.org>
AuthorDate: Fri Apr 16 11:20:39 2021 +0200

    Revert "[FLINK-22249][FLINK-22248] Temporarily disable JobMasterStopWithSavepointITCase"
    
    This reverts commit eb631935dcce5b037e3ad5245f48e373b5b3c426.
---
 .../flink/runtime/jobmaster/JobMasterStopWithSavepointITCase.java       | 2 --
 1 file changed, 2 deletions(-)

diff --git a/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterStopWithSavepointITCase.java b/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterStopWithSavepointITCase.java
index d4740992..4820eb0 100644
--- a/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterStopWithSavepointITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterStopWithSavepointITCase.java
@@ -47,7 +47,6 @@ import org.apache.flink.test.util.AbstractTestBase;
 import org.apache.flink.util.ExceptionUtils;
 
 import org.junit.Assume;
-import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
@@ -80,7 +79,6 @@ import static org.junit.Assert.fail;
  * ITCases testing the stop with savepoint functionality. This includes checking both SUSPEND and
  * TERMINATE.
  */
-@Ignore("FLINK-22249, FLINK-22248")
 public class JobMasterStopWithSavepointITCase extends AbstractTestBase {
 
     @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder();