You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by se...@apache.org on 2015/10/16 18:08:48 UTC

[21/24] flink git commit: [hotfix] [tests] Make StreamTaskTimerTest more robust

[hotfix] [tests] Make StreamTaskTimerTest more robust


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/4ee5b4cc
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/4ee5b4cc
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/4ee5b4cc

Branch: refs/heads/master
Commit: 4ee5b4cc15015f5e985372c6bdace4ef87281825
Parents: 3b7fb63
Author: Stephan Ewen <se...@apache.org>
Authored: Fri Oct 9 22:49:45 2015 +0200
Committer: Stephan Ewen <se...@apache.org>
Committed: Fri Oct 16 15:26:11 2015 +0200

----------------------------------------------------------------------
 .../streaming/runtime/operators/StreamTaskTimerTest.java    | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/4ee5b4cc/flink-staging/flink-streaming/flink-streaming-core/src/test/java/org/apache/flink/streaming/runtime/operators/StreamTaskTimerTest.java
----------------------------------------------------------------------
diff --git a/flink-staging/flink-streaming/flink-streaming-core/src/test/java/org/apache/flink/streaming/runtime/operators/StreamTaskTimerTest.java b/flink-staging/flink-streaming/flink-streaming-core/src/test/java/org/apache/flink/streaming/runtime/operators/StreamTaskTimerTest.java
index 67df3ad..0ddf272 100644
--- a/flink-staging/flink-streaming/flink-streaming-core/src/test/java/org/apache/flink/streaming/runtime/operators/StreamTaskTimerTest.java
+++ b/flink-staging/flink-streaming/flink-streaming-core/src/test/java/org/apache/flink/streaming/runtime/operators/StreamTaskTimerTest.java
@@ -48,6 +48,7 @@ public class StreamTaskTimerTest {
 	@Test
 	public void testOpenCloseAndTimestamps() throws Exception {
 		final OneInputStreamTask<String, String> mapTask = new OneInputStreamTask<>();
+		
 		final OneInputStreamTaskTestHarness<String, String> testHarness = new OneInputStreamTaskTestHarness<>(mapTask, BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.STRING_TYPE_INFO);
 
 		StreamConfig streamConfig = testHarness.getStreamConfig();
@@ -103,11 +104,7 @@ public class StreamTaskTimerTest {
 			mapTask.registerTimer(t3, new ValidatingTriggerable(errorRef, t3, 2));
 			mapTask.registerTimer(t4, new ValidatingTriggerable(errorRef, t4, 3));
 
-
-			testHarness.endInput();
-			testHarness.waitForTaskCompletion();
-
-			long deadline = System.currentTimeMillis() + 5000;
+			long deadline = System.currentTimeMillis() + 20000;
 			while (errorRef.get() == null &&
 					ValidatingTriggerable.numInSequence < 4 &&
 					System.currentTimeMillis() < deadline)
@@ -123,6 +120,8 @@ public class StreamTaskTimerTest {
 
 			assertEquals(4, ValidatingTriggerable.numInSequence);
 
+			testHarness.endInput();
+			testHarness.waitForTaskCompletion();
 
 			// wait until the trigger thread is shut down. otherwise, the other tests may become unstable
 			deadline = System.currentTimeMillis() + 4000;