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

Tsuyoshi Ozawa commented on MAPREDUCE-6165:
-------------------------------------------

OK, but it's not decision to reduce tests here. How about doing like this?
{code}
assertEquals(2, splits.size());
fileSplit = (CombineFileSplit) splits.get(0);
if (fileSplit.getNumPaths() == 2) {
  assertEquals(1, fileSplit.getLocations().length);
  assertEquals(file2.getName(), fileSplit.getPath(0).getName());
  assertEquals(0, fileSplit.getOffset(0));
  assertEquals(BLOCKSIZE, fileSplit.getLength(0));
  assertEquals(file2.getName(), fileSplit.getPath(1).getName());
  assertEquals(BLOCKSIZE, fileSplit.getOffset(1));
  assertEquals(BLOCKSIZE, fileSplit.getLength(1));
  assertEquals(hosts2[0], fileSplit.getLocations()[0]); // should be on r2
} else if (fileSplit.getNumPaths() == 1) {
  assertEquals(file1.getName(), fileSplit.getPath(0).getName());
  assertEquals(0, fileSplit.getOffset(0));
  assertEquals(BLOCKSIZE, fileSplit.getLength(0));
  assertEquals(hosts1[0], fileSplit.getLocations()[0]); // should be on r1
}
{code}

> [JDK8] TestCombineFileInputFormat failed on JDK8
> ------------------------------------------------
>
>                 Key: MAPREDUCE-6165
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-6165
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>            Reporter: Wei Yan
>            Assignee: Akira AJISAKA
>            Priority: Minor
>         Attachments: MAPREDUCE-6165-001.patch, MAPREDUCE-6165-reproduce.patch
>
>
> The error msg:
> {noformat}
> testSplitPlacementForCompressedFiles(org.apache.hadoop.mapreduce.lib.input.TestCombineFileInputFormat)
>   Time elapsed: 2.487 sec  <<< FAILURE!
> junit.framework.AssertionFailedError: expected:<2> but was:<1>
>       at junit.framework.Assert.fail(Assert.java:57)
>       at junit.framework.Assert.failNotEquals(Assert.java:329)
>       at junit.framework.Assert.assertEquals(Assert.java:78)
>       at junit.framework.Assert.assertEquals(Assert.java:234)
>       at junit.framework.Assert.assertEquals(Assert.java:241)
>       at junit.framework.TestCase.assertEquals(TestCase.java:409)
>       at 
> org.apache.hadoop.mapreduce.lib.input.TestCombineFileInputFormat.testSplitPlacementForCompressedFiles(TestCombineFileInputFormat.java:911)
> testSplitPlacement(org.apache.hadoop.mapreduce.lib.input.TestCombineFileInputFormat)
>   Time elapsed: 0.985 sec  <<< FAILURE!
> junit.framework.AssertionFailedError: expected:<2> but was:<1>
>       at junit.framework.Assert.fail(Assert.java:57)
>       at junit.framework.Assert.failNotEquals(Assert.java:329)
>       at junit.framework.Assert.assertEquals(Assert.java:78)
>       at junit.framework.Assert.assertEquals(Assert.java:234)
>       at junit.framework.Assert.assertEquals(Assert.java:241)
>       at junit.framework.TestCase.assertEquals(TestCase.java:409)
>       at 
> org.apache.hadoop.mapreduce.lib.input.TestCombineFileInputFormat.testSplitPlacement(TestCombineFileInputFormat.java:368)
> {noformat}



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

Reply via email to