Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A4BBC200B7C for ; Thu, 8 Sep 2016 17:28:25 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A373C160AD8; Thu, 8 Sep 2016 15:28:25 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CFF5D160AD9 for ; Thu, 8 Sep 2016 17:28:24 +0200 (CEST) Received: (qmail 31740 invoked by uid 500); 8 Sep 2016 15:28:24 -0000 Mailing-List: contact commits-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list commits@flink.apache.org Received: (qmail 31493 invoked by uid 99); 8 Sep 2016 15:28:23 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Sep 2016 15:28:23 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A2589E7E00; Thu, 8 Sep 2016 15:28:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: trohrmann@apache.org To: commits@flink.apache.org Date: Thu, 08 Sep 2016 15:28:30 -0000 Message-Id: <43b03394c6ee43dfa091748a0f75250f@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [08/50] [abbrv] flink git commit: [FLINK-4073] fix stability of TaskManagerFailure test archived-at: Thu, 08 Sep 2016 15:28:25 -0000 [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 Authored: Mon Sep 5 16:05:50 2016 +0200 Committer: Maximilian Michels 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 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()); }