flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trohrm...@apache.org
Subject [01/14] flink git commit: [FLINK-7057][tests][hotfix] fix test instability of JobManagerCleanupITCase#testBlobServerCleanupCancelledJob
Date Thu, 05 Oct 2017 14:06:54 GMT
Repository: flink
Updated Branches:
  refs/heads/master 4947ee669 -> 84a07a34a


[FLINK-7057][tests][hotfix] fix test instability of JobManagerCleanupITCase#testBlobServerCleanupCancelledJob

This test expected two messages to arrice (job cancellation and job state change
notification) but did not take different receive orders into account. The fix:
- removes state change listening for this test case so that only one message
  arrives, and
- adds message comparison by object, not just class (to improve debugging)


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

Branch: refs/heads/master
Commit: 98f6dea1e22df539fc75edab72a946eb04a88a23
Parents: 40ef908
Author: Nico Kruber <nico@data-artisans.com>
Authored: Fri Aug 18 12:28:23 2017 +0200
Committer: Till Rohrmann <trohrmann@apache.org>
Committed: Thu Oct 5 16:06:26 2017 +0200

----------------------------------------------------------------------
 .../runtime/jobmanager/JobManagerCleanupITCase.java  | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/98f6dea1/flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerCleanupITCase.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerCleanupITCase.java
b/flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerCleanupITCase.java
index b2b455b..de30d1d 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerCleanupITCase.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerCleanupITCase.java
@@ -201,12 +201,18 @@ public class JobManagerCleanupITCase extends TestLogger {
 						jobManagerGateway.tell(
 							new JobManagerMessages.SubmitJob(
 								jobGraph,
-								ListeningBehaviour.EXECUTION_RESULT),
+								// NOTE: to not receive two different (arbitrarily ordered) messages
+								//       upon cancellation, only listen for the job submission
+								//       message when cancelling the job
+								testCase == TestCase.JOB_IS_CANCELLED ?
+									ListeningBehaviour.DETACHED :
+									ListeningBehaviour.EXECUTION_RESULT
+							),
 							testActorGateway);
 						if (testCase == TestCase.JOB_SUBMISSION_FAILS) {
 							expectMsgClass(JobManagerMessages.JobResultFailure.class);
 						} else {
-							expectMsgClass(JobManagerMessages.JobSubmitSuccess.class);
+							expectMsgEquals(new JobManagerMessages.JobSubmitSuccess(jid));
 
 							if (testCase == TestCase.JOB_FAILS) {
 								// fail a task so that the job is going to be recovered (we actually do not
@@ -221,11 +227,8 @@ public class JobManagerCleanupITCase extends TestLogger {
 								jobManagerGateway.tell(
 									new JobManagerMessages.CancelJob(jid),
 									testActorGateway);
-								expectMsgClass(JobManagerMessages.CancellationResponse.class);
 
-								// job will be cancelled and everything should be cleaned up
-
-								expectMsgClass(JobManagerMessages.JobResultFailure.class);
+								expectMsgEquals(new JobManagerMessages.CancellationSuccess(jid, null));
 							} else {
 								expectMsgClass(JobManagerMessages.JobResultSuccess.class);
 							}


Mime
View raw message