Browse Source

HADOOP-5305. Increase number of files and print debug messages in TestCopyFiles. (szetszwo)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.20@761832 13f79535-47bb-0310-9956-ffa450edef68
Tsz-wo Sze 16 years ago
parent
commit
5b076878af
2 changed files with 15 additions and 4 deletions
  1. 3 0
      CHANGES.txt
  2. 12 4
      src/test/org/apache/hadoop/fs/TestCopyFiles.java

+ 3 - 0
CHANGES.txt

@@ -843,6 +843,9 @@ Release 0.20.0 - Unreleased
     HADOOP-5227. Fix distcp so -update and -delete can be meaningfully
     combined. (Tsz Wo (Nicholas), SZE via cdouglas)
 
+    HADOOP-5305. Increase number of files and print debug messages in
+    TestCopyFiles.  (szetszwo)
+
 Release 0.19.2 - Unreleased
 
   BUG FIXES

+ 12 - 4
src/test/org/apache/hadoop/fs/TestCopyFiles.java

@@ -60,7 +60,7 @@ public class TestCopyFiles extends TestCase {
   static final URI LOCAL_FS = URI.create("file:///");
   
   private static final Random RAN = new Random();
-  private static final int NFILES = 7;
+  private static final int NFILES = 20;
   private static String TEST_ROOT_DIR =
     new Path(System.getProperty("test.build.data","/tmp"))
     .toString().replace(' ', '+');
@@ -564,6 +564,7 @@ public class TestCopyFiles extends TestCase {
       Configuration conf = new Configuration();
       dfs = new MiniDFSCluster(conf, 3, true, null);
       FileSystem fs = dfs.getFileSystem();
+      final FsShell shell = new FsShell(conf);
       namenode = fs.getUri().toString();
       mr = new MiniMRCluster(3, namenode, 1);
       MyFile[] files = createFiles(fs.getUri(), "/srcdat");
@@ -581,9 +582,13 @@ public class TestCopyFiles extends TestCase {
                         namenode+"/destdat"});
       assertTrue("Source and destination directories do not match.",
                  checkFiles(fs, "/destdat", files));
-      FileStatus[] logs = fs.listStatus(new Path(namenode+"/logs"));
+
+      String logdir = namenode + "/logs";
+      System.out.println(execCmd(shell, "-lsr", logdir));
+      FileStatus[] logs = fs.listStatus(new Path(logdir));
       // rare case where splits are exact, logs.length can be 4
-      assertTrue("Unexpected map count", logs.length == 5 || logs.length == 4);
+      assertTrue("Unexpected map count, logs.length=" + logs.length,
+          logs.length == 5 || logs.length == 4);
 
       deldir(fs, "/destdat");
       deldir(fs, "/logs");
@@ -593,8 +598,11 @@ public class TestCopyFiles extends TestCase {
                         namenode+"/logs",
                         namenode+"/srcdat",
                         namenode+"/destdat"});
+
+      System.out.println(execCmd(shell, "-lsr", logdir));
       logs = fs.listStatus(new Path(namenode+"/logs"));
-      assertTrue("Unexpected map count", logs.length == 2);
+      assertTrue("Unexpected map count, logs.length=" + logs.length,
+          logs.length == 2);
     } finally {
       if (dfs != null) { dfs.shutdown(); }
       if (mr != null) { mr.shutdown(); }