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
This commit is contained in:
Todd Lipcon 2011-11-14 23:34:21 +00:00
parent 4cdcf7b867
commit 51ce383112
2 changed files with 7 additions and 2 deletions

View File

@ -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");

View File

@ -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();