Quellcode durchsuchen

HDFS-774. Intermittent race condition in TestFiPipelines. Contributed by Konstantin Boudnik

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hdfs/trunk@880971 13f79535-47bb-0310-9956-ffa450edef68
Konstantin Boudnik vor 15 Jahren
Ursprung
Commit
232e7cea0a
2 geänderte Dateien mit 7 neuen und 7 gelöschten Zeilen
  1. 2 0
      CHANGES.txt
  2. 5 7
      src/test/aop/org/apache/hadoop/hdfs/TestFiPipelines.java

+ 2 - 0
CHANGES.txt

@@ -55,6 +55,8 @@ Trunk (unreleased changes)
 
     HDFS-751. Fix TestCrcCorruption to pick up the correct datablocks to
     corrupt. (dhruba)
+    
+    HDFS-774. Intermittent race condition in TestFiPipelines (cos)
 
 Release 0.21.0 - Unreleased
 

+ 5 - 7
src/test/aop/org/apache/hadoop/hdfs/TestFiPipelines.java

@@ -62,13 +62,10 @@ public class TestFiPipelines {
   }
 
   @After
-  public void shutDownCluster() throws IOException {
-    if (fs != null)
-      fs.close();
-    if (cluster != null)
-      cluster.shutdown();
+  synchronized public void shutDownCluster() throws IOException {
+    if (cluster != null) cluster.shutdown();
   }
-  
+
   /**
    * Test initiates and sets actions created by injection framework. The actions
    * work with both aspects of sending acknologment packets in a pipeline.
@@ -194,7 +191,8 @@ public class TestFiPipelines {
         // It has to be done like that, because local version of shutDownCluster()
         // won't work, because it tries to close an instance of FileSystem too.
         // Which is where the waiting is happening.
-        if (cluster !=null ) cluster.shutdown();
+        if (cluster !=null )
+          shutDownCluster();
       } catch (Exception e) {
         e.printStackTrace();
       }