You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by pn...@apache.org on 2021/11/02 11:31:57 UTC
[flink] branch release-1.13 updated: [FLINK-15550][runtime] Don't
ignore the interruption for testCancelTaskExceptionAfterTaskMarkedFailed
This is an automated email from the ASF dual-hosted git repository.
pnowojski pushed a commit to branch release-1.13
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.13 by this push:
new e050f37 [FLINK-15550][runtime] Don't ignore the interruption for testCancelTaskExceptionAfterTaskMarkedFailed
e050f37 is described below
commit e050f371aca2b3a834d76c4555fe8abe5d3dcc00
Author: Anton Kalashnikov <ka...@yandex.ru>
AuthorDate: Mon Oct 25 14:12:52 2021 +0200
[FLINK-15550][runtime] Don't ignore the interruption for testCancelTaskExceptionAfterTaskMarkedFailed
---
.../apache/flink/runtime/taskmanager/TaskTest.java | 35 +++++++++++-----------
1 file changed, 17 insertions(+), 18 deletions(-)
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskTest.java
index d7eecb0..c4e8ecd 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskTest.java
@@ -1258,23 +1258,27 @@ public class TaskTest extends TestLogger {
@Override
public void invoke() {
- awaitLatch.trigger();
-
- // make sure that the interrupt call does not
- // grab us out of the lock early
- while (true) {
- try {
- triggerLatch.await();
- break;
- } catch (InterruptedException e) {
- // fall through the loop
- }
- }
+ awaitTriggerLatch();
throw new RuntimeException("test");
}
}
+ private static void awaitTriggerLatch() {
+ awaitLatch.trigger();
+
+ // make sure that the interrupt call does not
+ // grab us out of the lock early
+ while (true) {
+ try {
+ triggerLatch.await();
+ break;
+ } catch (InterruptedException e) {
+ // fall through the loop
+ }
+ }
+ }
+
/** {@link AbstractInvokable} which throws {@link CancelTaskException} on invoke. */
public static final class InvokableWithCancelTaskExceptionInInvoke extends AbstractInvokable {
public InvokableWithCancelTaskExceptionInInvoke(Environment environment) {
@@ -1283,12 +1287,7 @@ public class TaskTest extends TestLogger {
@Override
public void invoke() {
- awaitLatch.trigger();
-
- try {
- triggerLatch.await();
- } catch (Throwable ignored) {
- }
+ awaitTriggerLatch();
throw new CancelTaskException();
}