فهرست منبع

HADOOP-3195. Fix TestFileSystem to be deterministic.
Contributed by Tsz Wo (Nicholas), SZE.



git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.17@645744 13f79535-47bb-0310-9956-ffa450edef68

Christopher Douglas 17 سال پیش
والد
کامیت
693c38cc35
2فایلهای تغییر یافته به همراه5 افزوده شده و 4 حذف شده
  1. 3 0
      CHANGES.txt
  2. 2 4
      src/test/org/apache/hadoop/fs/TestFileSystem.java

+ 3 - 0
CHANGES.txt

@@ -540,6 +540,9 @@ Release 0.16.3 - Unreleased
     closeAll() that causes spurious warnings and a deadlock.
     (Tsz Wo (Nicholas), SZE via cdouglas)
 
+    HADOOP-3195. Fix TestFileSystem to be deterministic.
+    (Tsz Wo (Nicholas), SZE via cdouglas)
+
 Release 0.16.2 - 2008-04-02
 
   BUG FIXES

+ 2 - 4
src/test/org/apache/hadoop/fs/TestFileSystem.java

@@ -492,11 +492,9 @@ public class TestFileSystem extends TestCase {
       try {
         cluster = new MiniDFSCluster(new Configuration(), 2, true, null);
         URI uri = cluster.getFileSystem().getUri();
-        FileSystem.get(uri, new Configuration());
-        int n = Thread.activeCount();
+        FileSystem fs = FileSystem.get(uri, new Configuration());
         for(int i = 0; i < 100; i++) {
-          FileSystem.get(uri, new Configuration());
-          assertTrue(n >= Thread.activeCount());
+          assertTrue(fs == FileSystem.get(uri, new Configuration()));
         }
       } finally {
         cluster.shutdown();