From f342dbcfc750d10028fdea0579a4822d5cf1e545 Mon Sep 17 00:00:00 2001 From: Jian He Date: Mon, 6 Jan 2014 18:57:23 +0000 Subject: [PATCH] YARN-1560. Fixed TestYarnClient#testAMMRTokens failure with null AMRM token. (Contributed by Ted Yu) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1555975 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../yarn/client/api/impl/TestYarnClient.java | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index ef98e212f2..69776c3348 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -289,6 +289,9 @@ Release 2.4.0 - UNRELEASED YARN-1559. Race between ServerRMProxy and ClientRMProxy setting RMProxy#INSTANCE. (kasha and vinodkv via kasha) + YARN-1560. Fixed TestYarnClient#testAMMRTokens failure with null AMRM token. + (Ted Yu via jianhe) + Release 2.3.0 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClient.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClient.java index 966995c99c..00ab7895d6 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClient.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClient.java @@ -378,6 +378,13 @@ public void testAMMRTokens() throws Exception { appId = createApp(rmClient, true); waitTillAccepted(rmClient, appId); + long start = System.currentTimeMillis(); + while (rmClient.getAMRMToken(appId) == null) { + if (System.currentTimeMillis() - start > 20 * 1000) { + Assert.fail("AMRM token is null"); + } + Thread.sleep(100); + } //unmanaged AMs do return AMRM token Assert.assertNotNull(rmClient.getAMRMToken(appId)); @@ -392,6 +399,13 @@ public ApplicationId run() throws Exception { rmClient.start(); ApplicationId appId = createApp(rmClient, true); waitTillAccepted(rmClient, appId); + long start = System.currentTimeMillis(); + while (rmClient.getAMRMToken(appId) == null) { + if (System.currentTimeMillis() - start > 20 * 1000) { + Assert.fail("AMRM token is null"); + } + Thread.sleep(100); + } //unmanaged AMs do return AMRM token Assert.assertNotNull(rmClient.getAMRMToken(appId)); return appId;