Index: lucene/common-build.xml
===================================================================
--- lucene/common-build.xml	(revision 1169473)
+++ lucene/common-build.xml	(working copy)
@@ -95,6 +95,15 @@
   <property name="tests.loggingfile" value="/dev/null"/>
   <property name="tests.nightly" value="false" />
   <property name="tests.cleanthreads.sysprop" value="perMethod"/>
+
+  <condition property="tests.timeout" value="36000000"> <!-- 10 hours -->
+    <and>
+      <isset property="testcase"/>
+      <equals arg1="${testcase}" arg2="Test2BTerms"/>
+    </and>
+  </condition>
+
+  <property name="tests.timeout" value="3600000"/> <!-- 1 hour -->
     
   <property name="javac.deprecation" value="off"/>
   <property name="javac.debug" value="on"/>
@@ -535,7 +544,8 @@
 	    -->
     	<touch file="@{tempDir}/@{threadNum}/quiet.ant" verbose="false" mkdirs="true"/>
 	    <junit printsummary="off" haltonfailure="no" maxmemory="512M" tempdir="@{tempDir}/@{threadNum}"
-	      errorProperty="tests.failed" failureProperty="tests.failed" forkmode="perBatch" dir="@{tempDir}/@{threadNum}">
+	      errorProperty="tests.failed" failureProperty="tests.failed" forkmode="perBatch" dir="@{tempDir}/@{threadNum}"
+              timeout="${tests.timeout}">
 	      <classpath refid="@{junit.classpath}"/>
 	      <assertions>
 	        <enable package="org.apache.lucene"/>
