You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by rm...@apache.org on 2014/10/17 16:52:37 UTC
[10/11] git commit: Better test error messages when canceling tests
fail
Better test error messages when canceling tests fail
Project: http://git-wip-us.apache.org/repos/asf/incubator-flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-flink/commit/c8d4e763
Tree: http://git-wip-us.apache.org/repos/asf/incubator-flink/tree/c8d4e763
Diff: http://git-wip-us.apache.org/repos/asf/incubator-flink/diff/c8d4e763
Branch: refs/heads/release-0.7
Commit: c8d4e7639b4372483cf8a43338cb46c4891e53db
Parents: 446a247
Author: Stephan Ewen <se...@apache.org>
Authored: Tue Oct 14 15:52:34 2014 +0200
Committer: Robert Metzger <rm...@apache.org>
Committed: Fri Oct 17 16:48:55 2014 +0200
----------------------------------------------------------------------
.../operators/testutils/TaskCancelThread.java | 21 +++++++++-----------
.../operators/testutils/TaskTestBase.java | 4 ----
2 files changed, 9 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/c8d4e763/flink-runtime/src/test/java/org/apache/flink/runtime/operators/testutils/TaskCancelThread.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/operators/testutils/TaskCancelThread.java b/flink-runtime/src/test/java/org/apache/flink/runtime/operators/testutils/TaskCancelThread.java
index 9eef7ab..0afb1e3 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/operators/testutils/TaskCancelThread.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/operators/testutils/TaskCancelThread.java
@@ -16,15 +16,14 @@
* limitations under the License.
*/
-
package org.apache.flink.runtime.operators.testutils;
import org.apache.flink.runtime.jobgraph.tasks.AbstractInvokable;
-
+import org.apache.flink.util.ExceptionUtils;
import org.junit.Assert;
-public class TaskCancelThread extends Thread
-{
+public class TaskCancelThread extends Thread {
+
private final DriverTestBase<?> cancelDriver;
private final AbstractInvokable cancelTask;
private final Thread interruptedThread;
@@ -33,16 +32,14 @@ public class TaskCancelThread extends Thread
- public TaskCancelThread(int cancelTimeout, Thread interruptedThread, DriverTestBase<?> canceledTask)
- {
+ public TaskCancelThread(int cancelTimeout, Thread interruptedThread, DriverTestBase<?> canceledTask) {
this.cancelTimeout = cancelTimeout;
this.interruptedThread = interruptedThread;
this.cancelDriver = canceledTask;
this.cancelTask = null;
}
- public TaskCancelThread(int cancelTimeout, Thread interruptedThread, AbstractInvokable canceledTask)
- {
+ public TaskCancelThread(int cancelTimeout, Thread interruptedThread, AbstractInvokable canceledTask) {
this.cancelTimeout = cancelTimeout;
this.interruptedThread = interruptedThread;
this.cancelDriver = null;
@@ -50,11 +47,11 @@ public class TaskCancelThread extends Thread
}
@Override
- public void run()
- {
+ public void run() {
try {
Thread.sleep(this.cancelTimeout*1000);
- } catch (InterruptedException e) {
+ }
+ catch (InterruptedException e) {
Assert.fail("CancelThread interruped while waiting for cancel timeout");
}
@@ -68,7 +65,7 @@ public class TaskCancelThread extends Thread
this.interruptedThread.interrupt();
} catch (Exception e) {
- Assert.fail("Canceling task failed");
+ Assert.fail("Canceling task failed: " + ExceptionUtils.stringifyException(e));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/c8d4e763/flink-runtime/src/test/java/org/apache/flink/runtime/operators/testutils/TaskTestBase.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/operators/testutils/TaskTestBase.java b/flink-runtime/src/test/java/org/apache/flink/runtime/operators/testutils/TaskTestBase.java
index a159d0e..9351929 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/operators/testutils/TaskTestBase.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/operators/testutils/TaskTestBase.java
@@ -16,7 +16,6 @@
* limitations under the License.
*/
-
package org.apache.flink.runtime.operators.testutils;
import java.util.List;
@@ -32,10 +31,7 @@ import org.apache.flink.core.fs.Path;
import org.apache.flink.core.fs.FileSystem.WriteMode;
import org.apache.flink.runtime.jobgraph.tasks.AbstractInvokable;
import org.apache.flink.runtime.memorymanager.MemoryManager;
-import org.apache.flink.runtime.operators.DataSinkTask;
-import org.apache.flink.runtime.operators.DataSourceTask;
import org.apache.flink.runtime.operators.PactDriver;
-import org.apache.flink.runtime.operators.RegularPactTask;
import org.apache.flink.runtime.operators.shipping.ShipStrategyType;
import org.apache.flink.runtime.operators.util.TaskConfig;
import org.apache.flink.types.Record;