You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ni...@apache.org on 2008/03/09 01:12:16 UTC

svn commit: r635123 - in /hadoop/core/branches/branch-0.16: CHANGES.txt src/test/org/apache/hadoop/fs/TestDU.java

Author: nigel
Date: Sat Mar  8 16:12:14 2008
New Revision: 635123

URL: http://svn.apache.org/viewvc?rev=635123&view=rev
Log:
Merge -r 628998:628999 from trunk to branch-0.16 to fix HADOOP-2813.

Modified:
    hadoop/core/branches/branch-0.16/CHANGES.txt
    hadoop/core/branches/branch-0.16/src/test/org/apache/hadoop/fs/TestDU.java

Modified: hadoop/core/branches/branch-0.16/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.16/CHANGES.txt?rev=635123&r1=635122&r2=635123&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.16/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.16/CHANGES.txt Sat Mar  8 16:12:14 2008
@@ -135,6 +135,9 @@
     HADOOP-2915. Fixed FileSystem.CACHE so that a username is included
     in the cache key. (Tsz Wo (Nicholas), SZE via nigel)
 
+    HADOOP-2813. TestDU unit test uses its own directory to run its
+    sequence of tests.  (Mahadev Konar via dhruba)
+
 Release 0.16.0 - 2008-02-07
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/branches/branch-0.16/src/test/org/apache/hadoop/fs/TestDU.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.16/src/test/org/apache/hadoop/fs/TestDU.java?rev=635123&r1=635122&r2=635123&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.16/src/test/org/apache/hadoop/fs/TestDU.java (original)
+++ hadoop/core/branches/branch-0.16/src/test/org/apache/hadoop/fs/TestDU.java Sat Mar  8 16:12:14 2008
@@ -25,7 +25,8 @@
 
 /** This test makes sure that "DU" does not get to run on each call to getUsed */ 
 public class TestDU extends TestCase {
-  final static private File DU_DIR = new File(".");
+  final static private File DU_DIR = new File(
+      System.getProperty("test.build.data","/tmp"), "dutmp");
   final static private File DU_FILE1 = new File(DU_DIR, "tmp1");
   final static private File DU_FILE2 = new File(DU_DIR, "tmp2");
   
@@ -50,6 +51,8 @@
   private void testDU(long interval) throws IOException {
     rmFile(DU_FILE1);
     rmFile(DU_FILE2);
+    DU_DIR.delete();
+    assertTrue(DU_DIR.mkdirs());
     try {
       createFile(DU_FILE1);
       DU du = new DU(DU_DIR, interval*60000);
@@ -64,6 +67,7 @@
     } finally {
       rmFile(DU_FILE1);
       rmFile(DU_FILE2);
+      DU_DIR.delete();
     }
   }