Explorar el Código

HDFS-2532. Add timeout to TestDfsOverAvroRpc

This test is timing out on trunk, causing tests below it to
fail spuriously. This patch doesn't fix the issue -- just adds
a JUnit timeout so that the failure is properly attributed
to this test.


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1201963 13f79535-47bb-0310-9956-ffa450edef68
Todd Lipcon hace 13 años
padre
commit
51ce383112

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDfsOverAvroRpc.java

@@ -19,11 +19,14 @@ package org.apache.hadoop.hdfs;
 
 import java.io.IOException;
 
+import org.junit.Test;
+
 /** Test for simple signs of life using Avro RPC.  Not an exhaustive test
  * yet, just enough to catch fundamental problems using Avro reflection to
  * infer namenode RPC protocols. */
 public class TestDfsOverAvroRpc extends TestLocalDFS {
 
+  @Test(timeout=20000)
   public void testWorkingDirectory() throws IOException {
     System.setProperty("hdfs.rpc.engine",
                        "org.apache.hadoop.ipc.AvroRpcEngine");

+ 4 - 2
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestLocalDFS.java

@@ -17,7 +17,8 @@
  */
 package org.apache.hadoop.hdfs;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.*;
 import java.io.*;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
@@ -27,7 +28,7 @@ import org.apache.hadoop.fs.Path;
  * This class tests the DFS class via the FileSystem interface in a single node
  * mini-cluster.
  */
-public class TestLocalDFS extends TestCase {
+public class TestLocalDFS {
 
   private void writeFile(FileSystem fileSys, Path name) throws IOException {
     DataOutputStream stm = fileSys.create(name);
@@ -59,6 +60,7 @@ public class TestLocalDFS extends TestCase {
   /**
    * Tests get/set working directory in DFS.
    */
+  @Test(timeout=20000)
   public void testWorkingDirectory() throws IOException {
     Configuration conf = new HdfsConfiguration();
     MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).build();