瀏覽代碼

HADOOP-1217. Add a test.timeout property to build.xml, so that long running unit tests may be automatically timed out. Contributed by Nigel.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@526314 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 18 年之前
父節點
當前提交
b0af97f7c6
共有 3 個文件被更改,包括 10 次插入2 次删除
  1. 4 0
      CHANGES.txt
  2. 2 1
      build.xml
  3. 4 1
      src/contrib/build-contrib.xml

+ 4 - 0
CHANGES.txt

@@ -119,6 +119,10 @@ Trunk (unreleased changes)
     MiniDFSCluster to start and stop NameNode/DataNodes.
     (Nigel Daley via tomwhite)
 
+38. HADOOP-1217.  Add test.timeout property to build.xml, so that
+    long-running unit tests may be automatically terminated.
+    (Nigel Daley via cutting)
+
 
 Release 0.12.3 - 2007-04-06
 

+ 2 - 1
build.xml

@@ -48,6 +48,7 @@
   <property name="test.include" value="Test*"/>
   <property name="test.classpath.id" value="test.classpath"/>
   <property name="test.output" value="no"/>
+  <property name="test.timeout" value="900000"/>
   <property name="test.junit.output.format" value="plain"/>
 
   <property name="libhdfs.test.conf.dir" value="${libhdfs.src}/tests/conf"/>
@@ -438,7 +439,7 @@
     <delete dir="${test.log.dir}"/>
     <mkdir dir="${test.log.dir}"/>
     <junit showoutput="${test.output}" printsummary="yes" haltonfailure="no" 
-           fork="yes" maxmemory="256m" dir="${basedir}"
+           fork="yes" maxmemory="256m" dir="${basedir}" timeout="${test.timeout}"
       errorProperty="tests.failed" failureProperty="tests.failed">
       <sysproperty key="test.build.data" value="${test.build.data}"/>
       <sysproperty key="hadoop.log.dir" value="${test.log.dir}"/>

+ 4 - 1
src/contrib/build-contrib.xml

@@ -21,6 +21,8 @@
 
   <property name="conf.dir" location="${hadoop.root}/conf"/>
   <property name="test.junit.output.format" value="plain"/>
+  <property name="test.output" value="no"/>
+  <property name="test.timeout" value="900000"/>
   <property name="build.dir" location="${hadoop.root}/build/contrib/${name}"/>
   <property name="build.classes" location="${build.dir}/classes"/>
   <property name="build.test" location="${build.dir}/test"/>
@@ -136,7 +138,8 @@
     <junit
       printsummary="yes" showoutput="${test.output}" 
       haltonfailure="no" fork="yes" maxmemory="256m"
-      errorProperty="tests.failed" failureProperty="tests.failed">
+      errorProperty="tests.failed" failureProperty="tests.failed"
+      timeout="${test.timeout}">
       
       <sysproperty key="test.build.data" value="${build.test}/data"/>
       <sysproperty key="build.test" value="${build.test}"/>