Browse Source

HADOOP-696. Fix TestTextInputFormat to not rely on the order of directory listings. Contributed by Sameer.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@473439 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 18 years ago
parent
commit
f830175707
2 changed files with 8 additions and 0 deletions
  1. 3 0
      CHANGES.txt
  2. 5 0
      src/test/org/apache/hadoop/mapred/TestTextInputFormat.java

+ 3 - 0
CHANGES.txt

@@ -38,6 +38,9 @@ Trunk (unreleased changes)
     are not collected like normal buffers, and provided little
     advantage.  (Raghu Angadi via cutting)
 
+12. HADOOP-696.  Fix TestTextInputFormat unit test to not rely on the
+    order of directory listings.  (Sameer Paranjpye via cutting)
+
 
 Release 0.8.0 - 2006-11-03
 

+ 5 - 0
src/test/org/apache/hadoop/mapred/TestTextInputFormat.java

@@ -215,6 +215,11 @@ public class TestTextInputFormat extends TestCase {
     format.configure(job);
     FileSplit[] splits = format.getSplits(localFs, job, 100);
     assertEquals("compressed splits == 2", 2, splits.length);
+    if (splits[0].getPath().getName().equals("part2.txt.gz")) {
+      FileSplit tmp = splits[0];
+      splits[0] = splits[1];
+      splits[1] = tmp;
+    }
     List<Text> results = readSplit(format, splits[0], job);
     assertEquals("splits[0] length", 6, results.size());
     assertEquals("splits[0][5]", " dog", results.get(5).toString());