You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2019/07/19 09:44:39 UTC

[flink] branch release-1.9 updated (a625735 -> 3f33e83)

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

chesnay pushed a change to branch release-1.9
in repository https://gitbox.apache.org/repos/asf/flink.git.


    from a625735  [hotfix][docs] Fix loop redirection in /dev/projectsetup/dependencies.html (#9177)
     new b9c09d8  [FLINK-12916][tests] Retry cancelWithSavepoint on cancellation barrier
     new 3f33e83  [FLINK-12916][tests] Rework regex

The 2 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:
 .../restore/AbstractOperatorRestoreTestBase.java    | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)


[flink] 02/02: [FLINK-12916][tests] Rework regex

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

chesnay pushed a commit to branch release-1.9
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 3f33e839e38c0e3677eccf0f9443736d1b613523
Author: Yun Tang <my...@live.com>
AuthorDate: Tue Jul 16 12:12:36 2019 +0200

    [FLINK-12916][tests] Rework regex
---
 .../restore/AbstractOperatorRestoreTestBase.java   | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/flink-tests/src/test/java/org/apache/flink/test/state/operator/restore/AbstractOperatorRestoreTestBase.java b/flink-tests/src/test/java/org/apache/flink/test/state/operator/restore/AbstractOperatorRestoreTestBase.java
index 0abdfeb..154477e 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/state/operator/restore/AbstractOperatorRestoreTestBase.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/state/operator/restore/AbstractOperatorRestoreTestBase.java
@@ -22,6 +22,7 @@ import org.apache.flink.api.common.restartstrategy.RestartStrategies;
 import org.apache.flink.api.common.time.Deadline;
 import org.apache.flink.api.common.time.Time;
 import org.apache.flink.client.program.ClusterClient;
+import org.apache.flink.runtime.checkpoint.CheckpointFailureReason;
 import org.apache.flink.runtime.checkpoint.savepoint.SavepointSerializers;
 import org.apache.flink.runtime.concurrent.FutureUtils;
 import org.apache.flink.runtime.jobgraph.JobGraph;
@@ -49,6 +50,8 @@ import java.time.Duration;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.TimeUnit;
 import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
@@ -67,12 +70,13 @@ public abstract class AbstractOperatorRestoreTestBase extends TestLogger {
 	private static final int NUM_SLOTS_PER_TM = 4;
 	private static final Duration TEST_TIMEOUT = Duration.ofSeconds(10000L);
 	private static final Pattern PATTERN_CANCEL_WITH_SAVEPOINT_TOLERATED_EXCEPTIONS = Pattern
-		.compile(
-			"(savepoint for the job .* failed)" +
-				"|(was not running)" +
-				"|(Not all required tasks are currently running)" +
-				"|(Checkpoint was declined \\(tasks not ready\\))" +
-				"|(Task received cancellation from one of its inputs)"
+		.compile(Stream
+			.of("was not running",
+				CheckpointFailureReason.NOT_ALL_REQUIRED_TASKS_RUNNING.message(),
+				CheckpointFailureReason.CHECKPOINT_DECLINED_TASK_NOT_READY.message(),
+				CheckpointFailureReason.CHECKPOINT_DECLINED_ON_CANCELLATION_BARRIER.message())
+			.map(AbstractOperatorRestoreTestBase::escapeRegexCharacters)
+			.collect(Collectors.joining(")|(", "(", ")"))
 		);
 
 	@Rule
@@ -227,4 +231,10 @@ public abstract class AbstractOperatorRestoreTestBase extends TestLogger {
 	 * @return savepoint directory to use
 	 */
 	protected abstract String getMigrationSavepointName();
+
+	private static String escapeRegexCharacters(String string) {
+		return string
+			.replaceAll("\\(", "\\\\(")
+			.replaceAll("\\)", "\\\\)");
+	}
 }


[flink] 01/02: [FLINK-12916][tests] Retry cancelWithSavepoint on cancellation barrier

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

chesnay pushed a commit to branch release-1.9
in repository https://gitbox.apache.org/repos/asf/flink.git

commit b9c09d832333be925c2bc8da75a1efc48f804065
Author: Yun Tang <my...@live.com>
AuthorDate: Fri Jun 21 12:39:38 2019 +0800

    [FLINK-12916][tests] Retry cancelWithSavepoint on cancellation barrier
---
 .../test/state/operator/restore/AbstractOperatorRestoreTestBase.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/flink-tests/src/test/java/org/apache/flink/test/state/operator/restore/AbstractOperatorRestoreTestBase.java b/flink-tests/src/test/java/org/apache/flink/test/state/operator/restore/AbstractOperatorRestoreTestBase.java
index 86a8aaa..0abdfeb 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/state/operator/restore/AbstractOperatorRestoreTestBase.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/state/operator/restore/AbstractOperatorRestoreTestBase.java
@@ -71,7 +71,8 @@ public abstract class AbstractOperatorRestoreTestBase extends TestLogger {
 			"(savepoint for the job .* failed)" +
 				"|(was not running)" +
 				"|(Not all required tasks are currently running)" +
-				"|(Checkpoint was declined \\(tasks not ready\\))"
+				"|(Checkpoint was declined \\(tasks not ready\\))" +
+				"|(Task received cancellation from one of its inputs)"
 		);
 
 	@Rule