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
This commit is contained in:
Jian He 2014-01-06 18:57:23 +00:00
parent 2cddd21db9
commit f342dbcfc7
2 changed files with 17 additions and 0 deletions

View File

@ -289,6 +289,9 @@ Release 2.4.0 - UNRELEASED
YARN-1559. Race between ServerRMProxy and ClientRMProxy setting YARN-1559. Race between ServerRMProxy and ClientRMProxy setting
RMProxy#INSTANCE. (kasha and vinodkv via kasha) 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 Release 2.3.0 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -378,6 +378,13 @@ public void testAMMRTokens() throws Exception {
appId = createApp(rmClient, true); appId = createApp(rmClient, true);
waitTillAccepted(rmClient, appId); 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 //unmanaged AMs do return AMRM token
Assert.assertNotNull(rmClient.getAMRMToken(appId)); Assert.assertNotNull(rmClient.getAMRMToken(appId));
@ -392,6 +399,13 @@ public ApplicationId run() throws Exception {
rmClient.start(); rmClient.start();
ApplicationId appId = createApp(rmClient, true); ApplicationId appId = createApp(rmClient, true);
waitTillAccepted(rmClient, appId); 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 //unmanaged AMs do return AMRM token
Assert.assertNotNull(rmClient.getAMRMToken(appId)); Assert.assertNotNull(rmClient.getAMRMToken(appId));
return appId; return appId;