[ 
https://issues.apache.org/jira/browse/MAPREDUCE-6088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14132461#comment-14132461
 ] 

zhihai xu commented on MAPREDUCE-6088:
--------------------------------------

I uploaded a patch MAPREDUCE-6088.branch-1.0.patch for review.

With the patch, the test can pass without dependence:
Testcase: testCleanUpTokenReferral took 0.011 sec
Testcase: testLocalJobTokenCache took 14.09 sec
Testcase: testGetTokensForNamenodes took 0.004 sec
Testcase: testGetTokensForUriWithoutAuth took 0.007 sec
Testcase: testTokenCache took 12.949 sec

The root cause for the test ( testLocalJobTokenCache ) failure is the JobConf 
used by testLocalJobTokenCache  didn't configure "mapred.job.tracker", so it 
call LocalJobRunner which don't create job token.
see the following code in JobClient.java
{code}
    String tracker = conf.get("mapred.job.tracker", "local");
    tasklogtimeout = conf.getInt(
      TASKLOG_PULL_TIMEOUT_KEY, DEFAULT_TASKLOG_TIMEOUT);
    this.ugi = UserGroupInformation.getCurrentUser();
    if ("local".equals(tracker)) {
      conf.setNumMapTasks(1);
      this.jobSubmitClient = new LocalJobRunner(conf);
    } else {
      this.rpcJobSubmitClient = 
          createRPCProxy(JobTracker.getAddress(conf), conf);
      this.jobSubmitClient = createProxy(this.rpcJobSubmitClient, conf);
    }        
{code}

> TestTokenCache in mrv1 (branch-1) depend on the order of test execution. 
> testLocalJobTokenCache will fail if it execute after testTokenCache.
> ---------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-6088
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-6088
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: mrv1, test
>            Reporter: zhihai xu
>            Assignee: zhihai xu
>         Attachments: MAPREDUCE-6088.branch-1.0.patch
>
>
> TestTokenCache in mrv1 (branch-1) depend on the order of test execution. 
> testLocalJobTokenCache will fail if it executed after testTokenCache.
> The reason is because testLocalJobTokenCache depends on the jConf setup by 
> testTokenCache.
> The fix is to set up the JobConf separately for testLocalJobTokenCache and 
> testTokenCache.
> See the following test result.
> Testcase: testLocalJobTokenCache took 1.197 sec
>       FAILED
> local Job failed
> junit.framework.AssertionFailedError: local Job failed
>       at 
> org.apache.hadoop.mapreduce.security.TestTokenCache.testLocalJobTokenCache(TestTokenCache.java:258)
> Testcase: testGetTokensForNamenodes took 0.003 sec
> Testcase: testGetTokensForUriWithoutAuth took 0.01 sec
> Testcase: testCleanUpTokenReferral took 0.014 sec
> Testcase: testTokenCache took 13.316 sec



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to