flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [2/2] flink git commit: [tests] Improve debuggability of ProcessReapingTests
Date Wed, 25 Feb 2015 14:10:52 GMT
[tests] Improve debuggability of ProcessReapingTests


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

Branch: refs/heads/master
Commit: c032725d356ddfc7c99a27560581a090e6a030ae
Parents: 9ca4219
Author: Stephan Ewen <sewen@apache.org>
Authored: Wed Feb 25 13:50:29 2015 +0100
Committer: Stephan Ewen <sewen@apache.org>
Committed: Wed Feb 25 13:58:43 2015 +0100

----------------------------------------------------------------------
 .../jobmanager/JobManagerProcessReapingTest.java       | 13 +++++++++++--
 .../taskmanager/TaskManagerProcessReapingTest.java     | 13 +++++++++++--
 2 files changed, 22 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/c032725d/flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerProcessReapingTest.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerProcessReapingTest.java
b/flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerProcessReapingTest.java
index ae3a771..1bb22d8 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerProcessReapingTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerProcessReapingTest.java
@@ -96,7 +96,8 @@ public class JobManagerProcessReapingTest {
 			// grab the reference to the JobManager. try multiple times, until the process
 			// is started and the JobManager is up
 			ActorRef jobManagerRef = null;
-			for (int i = 0; i < 20; i++) {
+			Throwable lastError = null;
+			for (int i = 0; i < 40; i++) {
 				try {
 					jobManagerRef = JobManager.getJobManagerRemoteReference(
 							new InetSocketAddress("localhost", jobManagerPort),
@@ -105,12 +106,20 @@ public class JobManagerProcessReapingTest {
 				}
 				catch (Throwable t) {
 					// job manager probably not ready yet
+					lastError = t;
 				}
 				Thread.sleep(500);
 			}
 
 			assertTrue("JobManager process died", isProcessAlive(jmProcess));
-			assertTrue("JobManager process did not launch the JobManager properly", jobManagerRef
!= null);
+
+			if (jobManagerRef == null) {
+				if (lastError != null) {
+					lastError.printStackTrace();
+				}
+				fail("JobManager process did not launch the JobManager properly. Failed to look up JobManager
actor at"
+						+ " localhost:" + jobManagerPort);
+			}
 
 			// kill the JobManager actor
 			jobManagerRef.tell(PoisonPill.getInstance(), ActorRef.noSender());

http://git-wip-us.apache.org/repos/asf/flink/blob/c032725d/flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskManagerProcessReapingTest.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskManagerProcessReapingTest.java
b/flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskManagerProcessReapingTest.java
index 2d752eb..a7173b4 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskManagerProcessReapingTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskManagerProcessReapingTest.java
@@ -109,7 +109,8 @@ public class TaskManagerProcessReapingTest {
 					"127.0.0.1", taskManagerPort, TaskManager.TASK_MANAGER_NAME());
 
 			ActorRef taskManagerRef = null;
-			for (int i = 0; i < 20; i++) {
+			Throwable lastError = null;
+			for (int i = 0; i < 40; i++) {
 				try {
 					taskManagerRef = TaskManager.getTaskManagerRemoteReference(
 							taskManagerActorName, jmActorSystem, new FiniteDuration(5, TimeUnit.SECONDS));
@@ -117,12 +118,20 @@ public class TaskManagerProcessReapingTest {
 				}
 				catch (Throwable t) {
 					// TaskManager probably not ready yet
+					lastError = t;
 				}
 				Thread.sleep(500);
 			}
 
 			assertTrue("TaskManager process died", isProcessAlive(taskManagerProcess));
-			assertTrue("TaskManager process did not launch the TaskManager properly", taskManagerRef
!= null);
+
+			if (taskManagerRef == null) {
+				if (lastError != null) {
+					lastError.printStackTrace();
+				}
+				fail("TaskManager process did not launch the TaskManager properly. Failed to look up
"
+						+ taskManagerActorName);
+			}
 
 			// kill the TaskManager actor
 			taskManagerRef.tell(PoisonPill.getInstance(), ActorRef.noSender());


Mime
View raw message