flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trohrm...@apache.org
Subject [08/50] [abbrv] flink git commit: [FLINK-4073] fix stability of TaskManagerFailure test
Date Thu, 08 Sep 2016 15:28:30 GMT
[FLINK-4073] fix stability of TaskManagerFailure test


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

Branch: refs/heads/flip-6
Commit: 2f87f61d34414074bc09ba8584d345bd400ed3cd
Parents: 9bbb8fa
Author: Maximilian Michels <mxm@apache.org>
Authored: Mon Sep 5 16:05:50 2016 +0200
Committer: Maximilian Michels <mxm@apache.org>
Committed: Mon Sep 5 16:14:03 2016 +0200

----------------------------------------------------------------------
 .../yarn/YARNSessionCapacitySchedulerITCase.java    | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/2f87f61d/flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNSessionCapacitySchedulerITCase.java
----------------------------------------------------------------------
diff --git a/flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNSessionCapacitySchedulerITCase.java
b/flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNSessionCapacitySchedulerITCase.java
index 513a9fc..886ec32 100644
--- a/flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNSessionCapacitySchedulerITCase.java
+++ b/flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNSessionCapacitySchedulerITCase.java
@@ -29,12 +29,13 @@ import org.apache.flink.test.testdata.WordCountData;
 import org.apache.flink.test.util.TestBaseUtils;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.yarn.api.protocolrecords.StopContainersRequest;
+import org.apache.hadoop.yarn.api.records.ApplicationId;
 import org.apache.hadoop.yarn.api.records.ApplicationReport;
 import org.apache.hadoop.yarn.api.records.ContainerId;
 import org.apache.hadoop.yarn.api.records.NodeReport;
-import org.apache.hadoop.yarn.api.records.YarnApplicationState;
 import org.apache.hadoop.yarn.api.records.NodeState;
-import org.apache.hadoop.yarn.api.records.ApplicationId;
+import org.apache.hadoop.yarn.api.records.Resource;
+import org.apache.hadoop.yarn.api.records.YarnApplicationState;
 import org.apache.hadoop.yarn.client.api.YarnClient;
 import org.apache.hadoop.yarn.conf.YarnConfiguration;
 import org.apache.hadoop.yarn.security.NMTokenIdentifier;
@@ -249,11 +250,16 @@ public class YARNSessionCapacitySchedulerITCase extends YarnTestBase
{
 			List<NodeReport> nodeReports = yc.getNodeReports(NodeState.RUNNING);
 
 			// we asked for one node with 2 vcores so we expect 2 vcores
-			int userVcores = 0;
+			// note that the JobManager may also run on the NodeManager
+			boolean foundVCoresSetting = false;
 			for (NodeReport rep: nodeReports) {
-				userVcores += rep.getUsed().getVirtualCores();
+				Resource resource = rep.getUsed();
+				if (resource != null && resource.getVirtualCores() == 2) {
+					foundVCoresSetting = true;
+					break;
+				}
 			}
-			Assert.assertEquals(2, userVcores);
+			Assert.assertTrue(foundVCoresSetting);
 		} catch (Exception e) {
 			Assert.fail("Test failed: " + e.getMessage());
 		}


Mime
View raw message