You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by mi...@apache.org on 2009/12/07 18:40:37 UTC
svn commit: r888041 - in /lucene/java/branches/lucene_3_0_back_compat_tests:
./ contrib/ contrib/highlighter/src/test/
src/java/org/apache/lucene/search/ src/test/org/apache/lucene/
src/test/org/apache/lucene/analysis/ src/test/org/apache/lucene/docume...
Author: mikemccand
Date: Mon Dec 7 17:40:36 2009
New Revision: 888041
URL: http://svn.apache.org/viewvc?rev=888041&view=rev
Log:
LUCENE-1844 (on back compat branch): speed up unit tests
Modified:
lucene/java/branches/lucene_3_0_back_compat_tests/ (props changed)
lucene/java/branches/lucene_3_0_back_compat_tests/CHANGES.txt (props changed)
lucene/java/branches/lucene_3_0_back_compat_tests/contrib/ (props changed)
lucene/java/branches/lucene_3_0_back_compat_tests/contrib/CHANGES.txt (props changed)
lucene/java/branches/lucene_3_0_back_compat_tests/contrib/highlighter/src/test/ (props changed)
lucene/java/branches/lucene_3_0_back_compat_tests/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java (props changed)
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/TestSnapshotDeletionPolicy.java
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java (props changed)
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/document/TestDateTools.java (props changed)
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/document/TestNumberTools.java (props changed)
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestAtomicUpdate.java
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java (props changed)
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderReopen.java
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriter.java
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterReader.java
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestNRTReaderWithThreads.java
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestStressIndexing.java
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestStressIndexing2.java
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestTransactions.java
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/CheckHits.java
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestBoolean2.java
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestNumericRangeQuery64.java
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/function/TestCustomScoreQuery.java
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/util/LuceneTestCase.java
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/util/TestAttributeSource.java (props changed)
lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/util/TestIndexableBinaryStringTools.java
Propchange: lucene/java/branches/lucene_3_0_back_compat_tests/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Dec 7 17:40:36 2009
@@ -2,4 +2,4 @@
/lucene/java/branches/lucene_2_9:817269-818600,825998,829134,829881,831036
/lucene/java/branches/lucene_2_9_back_compat_tests:818601-821336
/lucene/java/branches/lucene_3_0:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/trunk:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075
+/lucene/java/trunk:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214
Propchange: lucene/java/branches/lucene_3_0_back_compat_tests/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Dec 7 17:40:36 2009
@@ -2,4 +2,4 @@
/lucene/java/branches/lucene_2_9/CHANGES.txt:817269-818600,825998,829134,829881,831036
/lucene/java/branches/lucene_2_9_back_compat_tests/CHANGES.txt:818601-821336
/lucene/java/branches/lucene_3_0/CHANGES.txt:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/trunk/CHANGES.txt:881213,881315,881466,881819,882374,882464,882807,882888,882977,883074-883075
+/lucene/java/trunk/CHANGES.txt:881213,881315,881466,881819,882374,882464,882807,882888,882977,883074-883075,885214
Propchange: lucene/java/branches/lucene_3_0_back_compat_tests/contrib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Dec 7 17:40:36 2009
@@ -2,4 +2,4 @@
/lucene/java/branches/lucene_2_9/contrib:817269-818600,825998,829134,829816,829881,831036
/lucene/java/branches/lucene_2_9_back_compat_tests/contrib:818601-821336
/lucene/java/branches/lucene_3_0/contrib:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/trunk/contrib:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075
+/lucene/java/trunk/contrib:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214
Propchange: lucene/java/branches/lucene_3_0_back_compat_tests/contrib/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Dec 7 17:40:36 2009
@@ -2,4 +2,4 @@
/lucene/java/branches/lucene_2_9/contrib/CHANGES.txt:817269-818600,825998,826775,829134,829816,829881,831036
/lucene/java/branches/lucene_2_9_back_compat_tests/contrib/CHANGES.txt:818601-821336
/lucene/java/branches/lucene_3_0/contrib/CHANGES.txt:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/trunk/contrib/CHANGES.txt:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075
+/lucene/java/trunk/contrib/CHANGES.txt:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214
Propchange: lucene/java/branches/lucene_3_0_back_compat_tests/contrib/highlighter/src/test/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Dec 7 17:40:36 2009
@@ -2,4 +2,4 @@
/lucene/java/branches/lucene_2_9/contrib/highlighter/src/test:817269-818600,825998,826775,829134,829816,829881,831036
/lucene/java/branches/lucene_2_9_back_compat_tests/contrib/highlighter/src/test:818601-821336
/lucene/java/branches/lucene_3_0/contrib/highlighter/src/test:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/trunk/contrib/highlighter/src/test:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075
+/lucene/java/trunk/contrib/highlighter/src/test:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214
Propchange: lucene/java/branches/lucene_3_0_back_compat_tests/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Dec 7 17:40:36 2009
@@ -2,4 +2,4 @@
/lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:817269-818600,825998,829134,829881,831036
/lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:818601-821336
/lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/trunk/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:881213,881315,881466,881819,881984,882374,882807,882888,882977,883074-883075
+/lucene/java/trunk/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:881213,881315,881466,881819,881984,882374,882807,882888,882977,883074-883075,885214
Modified: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/TestSnapshotDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/TestSnapshotDeletionPolicy.java?rev=888041&r1=888040&r2=888041&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/TestSnapshotDeletionPolicy.java (original)
+++ lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/TestSnapshotDeletionPolicy.java Mon Dec 7 17:40:36 2009
@@ -108,8 +108,8 @@
}
private void runTest(Directory dir) throws Exception {
- // Run for ~7 seconds
- final long stopTime = System.currentTimeMillis() + 7000;
+ // Run for ~1 seconds
+ final long stopTime = System.currentTimeMillis() + 1000;
SnapshotDeletionPolicy dp = new SnapshotDeletionPolicy(new KeepOnlyLastCommitDeletionPolicy());
final IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), dp, IndexWriter.MaxFieldLength.UNLIMITED);
Propchange: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Dec 7 17:40:36 2009
@@ -1,4 +1,4 @@
/lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:748824
/lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:825998,829134,829881,831036
/lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075
+/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214
Propchange: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/document/TestDateTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Dec 7 17:40:36 2009
@@ -1,4 +1,4 @@
/lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/document/TestDateTools.java:748824
/lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/document/TestDateTools.java:825998,829134,829881,831036
/lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/document/TestDateTools.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/trunk/src/test/org/apache/lucene/document/TestDateTools.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075
+/lucene/java/trunk/src/test/org/apache/lucene/document/TestDateTools.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214
Propchange: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/document/TestNumberTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Dec 7 17:40:36 2009
@@ -1,4 +1,4 @@
/lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/document/TestNumberTools.java:748824
/lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/document/TestNumberTools.java:825998,829134,829881,831036
/lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/document/TestNumberTools.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/trunk/src/test/org/apache/lucene/document/TestNumberTools.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075
+/lucene/java/trunk/src/test/org/apache/lucene/document/TestNumberTools.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214
Modified: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestAtomicUpdate.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestAtomicUpdate.java?rev=888041&r1=888040&r2=888041&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestAtomicUpdate.java (original)
+++ lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestAtomicUpdate.java Mon Dec 7 17:40:36 2009
@@ -49,7 +49,7 @@
private static abstract class TimedThread extends Thread {
boolean failed;
int count;
- private static int RUN_TIME_SEC = 3;
+ private static float RUN_TIME_SEC = 0.5f;
private TimedThread[] allThreads;
abstract public void doWork() throws Throwable;
@@ -60,7 +60,7 @@
@Override
public void run() {
- final long stopTime = System.currentTimeMillis() + 1000*RUN_TIME_SEC;
+ final long stopTime = System.currentTimeMillis() + (long) (1000*RUN_TIME_SEC);
count = 0;
Propchange: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Dec 7 17:40:36 2009
@@ -1,4 +1,4 @@
/lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:748824
/lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:825998,829134,829881,831036
/lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075
+/lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214
Modified: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderReopen.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderReopen.java?rev=888041&r1=888040&r2=888041&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderReopen.java (original)
+++ lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderReopen.java Mon Dec 7 17:40:36 2009
@@ -699,7 +699,7 @@
public void testThreadSafety() throws Exception {
final Directory dir = new MockRAMDirectory();
- final int n = 150;
+ final int n = 30;
IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), IndexWriter.MaxFieldLength.LIMITED);
for (int i = 0; i < n; i++) {
@@ -741,7 +741,7 @@
final Set readersToClose = Collections.synchronizedSet(new HashSet());
for (int i = 0; i < n; i++) {
- if (i % 10 == 0) {
+ if (i % 2 == 0) {
IndexReader refreshed = reader.reopen();
if (refreshed != reader) {
readersToClose.add(reader);
@@ -754,7 +754,7 @@
ReaderThreadTask task;
- if (i < 20 ||( i >=50 && i < 70) || i > 90) {
+ if (i < 4 ||( i >=10 && i < 14) || i > 18) {
task = new ReaderThreadTask() {
@Override
@@ -825,7 +825,7 @@
}
synchronized(this) {
- wait(15000);
+ wait(1000);
}
for (int i = 0; i < n; i++) {
Modified: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriter.java?rev=888041&r1=888040&r2=888041&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriter.java (original)
+++ lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriter.java Mon Dec 7 17:40:36 2009
@@ -435,8 +435,8 @@
dir.close();
- // Try again with 2000 more bytes of free space:
- diskFree += 2000;
+ // Try again with 5000 more bytes of free space:
+ diskFree += 5000;
}
}
@@ -2202,7 +2202,7 @@
int idUpto = 0;
int fullCount = 0;
- final long stopTime = System.currentTimeMillis() + 500;
+ final long stopTime = System.currentTimeMillis() + 200;
while(System.currentTimeMillis() < stopTime) {
try {
@@ -2249,7 +2249,7 @@
public void testCloseWithThreads() throws Exception {
int NUM_THREADS = 3;
- for(int iter=0;iter<20;iter++) {
+ for(int iter=0;iter<7;iter++) {
MockRAMDirectory dir = new MockRAMDirectory();
IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), IndexWriter.MaxFieldLength.LIMITED);
ConcurrentMergeScheduler cms = new ConcurrentMergeScheduler();
@@ -2432,7 +2432,7 @@
int NUM_THREADS = 3;
- for(int iter=0;iter<5;iter++) {
+ for(int iter=0;iter<2;iter++) {
MockRAMDirectory dir = new MockRAMDirectory();
IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), IndexWriter.MaxFieldLength.LIMITED);
ConcurrentMergeScheduler cms = new ConcurrentMergeScheduler();
Modified: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java?rev=888041&r1=888040&r2=888041&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java (original)
+++ lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java Mon Dec 7 17:40:36 2009
@@ -63,7 +63,7 @@
final Field idField = new Field("id", "", Field.Store.YES, Field.Index.NOT_ANALYZED);
doc.add(idField);
- final long stopTime = System.currentTimeMillis() + 3000;
+ final long stopTime = System.currentTimeMillis() + 500;
while(System.currentTimeMillis() < stopTime) {
doFail.set(this);
Modified: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterReader.java?rev=888041&r1=888040&r2=888041&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterReader.java (original)
+++ lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterReader.java Mon Dec 7 17:40:36 2009
@@ -271,7 +271,7 @@
}
public void testAddIndexesAndDoDeletesThreads() throws Throwable {
- final int numIter = 5;
+ final int numIter = 2;
int numDirs = 3;
Directory mainDir = new MockRAMDirectory();
@@ -720,7 +720,7 @@
IndexReader r = writer.getReader();
final int NUM_THREAD = 5;
- final float SECONDS = 3;
+ final float SECONDS = 0.5f;
final long endTime = (long) (System.currentTimeMillis() + 1000.*SECONDS);
final List excs = Collections.synchronizedList(new ArrayList());
@@ -784,7 +784,7 @@
IndexReader r = writer.getReader();
final int NUM_THREAD = 5;
- final float SECONDS = 3;
+ final float SECONDS = 0.5f;
final long endTime = (long) (System.currentTimeMillis() + 1000.*SECONDS);
final List excs = Collections.synchronizedList(new ArrayList());
Modified: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestNRTReaderWithThreads.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestNRTReaderWithThreads.java?rev=888041&r1=888040&r2=888041&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestNRTReaderWithThreads.java (original)
+++ lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestNRTReaderWithThreads.java Mon Dec 7 17:40:36 2009
@@ -46,7 +46,7 @@
indexThreads[x].start();
}
long startTime = System.currentTimeMillis();
- long duration = 5*1000;
+ long duration = 1000;
while ((System.currentTimeMillis() - startTime) < duration) {
Thread.sleep(100);
}
Modified: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestStressIndexing.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestStressIndexing.java?rev=888041&r1=888040&r2=888041&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestStressIndexing.java (original)
+++ lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestStressIndexing.java Mon Dec 7 17:40:36 2009
@@ -33,7 +33,7 @@
private static abstract class TimedThread extends Thread {
boolean failed;
int count;
- private static int RUN_TIME_SEC = 6;
+ private static int RUN_TIME_SEC = 1;
private TimedThread[] allThreads;
abstract public void doWork() throws Throwable;
Modified: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestStressIndexing2.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestStressIndexing2.java?rev=888041&r1=888040&r2=888041&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestStressIndexing2.java (original)
+++ lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestStressIndexing2.java Mon Dec 7 17:40:36 2009
@@ -58,7 +58,7 @@
Directory dir = new MockRAMDirectory();
// TODO: verify equals using IW.getReader
- DocsAndWriter dw = indexRandomIWReader(10, 100, 100, dir);
+ DocsAndWriter dw = indexRandomIWReader(10, 10, 100, dir);
IndexReader r = dw.writer.getReader();
dw.writer.commit();
verifyEquals(r, dir, "id");
@@ -73,7 +73,7 @@
// dir1 = FSDirectory.open("foofoofoo");
Directory dir2 = new MockRAMDirectory();
// mergeFactor=2; maxBufferedDocs=2; Map docs = indexRandom(1, 3, 2, dir1);
- Map docs = indexRandom(10, 100, 100, dir1);
+ Map docs = indexRandom(10, 10, 100, dir1);
indexSerial(docs, dir2);
// verifying verify
@@ -86,7 +86,7 @@
public void testMultiConfig() throws Throwable {
// test lots of smaller different params together
r = newRandom();
- for (int i=0; i<100; i++) { // increase iterations for better testing
+ for (int i=0; i<20; i++) { // increase iterations for better testing
sameFieldOrder=r.nextBoolean();
mergeFactor=r.nextInt(3)+2;
maxBufferedDocs=r.nextInt(3)+2;
Modified: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestTransactions.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestTransactions.java?rev=888041&r1=888040&r2=888041&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestTransactions.java (original)
+++ lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestTransactions.java Mon Dec 7 17:40:36 2009
@@ -39,7 +39,7 @@
private static abstract class TimedThread extends Thread {
boolean failed;
- private static int RUN_TIME_SEC = 6;
+ private static float RUN_TIME_SEC = 0.5f;
private TimedThread[] allThreads;
abstract public void doWork() throws Throwable;
@@ -50,7 +50,7 @@
@Override
public void run() {
- final long stopTime = System.currentTimeMillis() + 1000*RUN_TIME_SEC;
+ final long stopTime = System.currentTimeMillis() + (long) (1000*RUN_TIME_SEC);
try {
while(System.currentTimeMillis() < stopTime && !anyErrors())
Modified: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/CheckHits.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/CheckHits.java?rev=888041&r1=888040&r2=888041&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/CheckHits.java (original)
+++ lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/CheckHits.java Mon Dec 7 17:40:36 2009
@@ -158,9 +158,6 @@
Searcher searcher,
int[] results)
throws IOException {
- if (searcher instanceof IndexSearcher) {
- QueryUtils.check(query,searcher);
- }
ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
Modified: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestBoolean2.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestBoolean2.java?rev=888041&r1=888040&r2=888041&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestBoolean2.java (original)
+++ lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestBoolean2.java Mon Dec 7 17:40:36 2009
@@ -208,7 +208,7 @@
try {
// increase number of iterations for more complete testing
- for (int i=0; i<1000; i++) {
+ for (int i=0; i<50; i++) {
int level = rnd.nextInt(3);
q1 = randBoolQuery(new Random(rnd.nextLong()), rnd.nextBoolean(), level, field, vals, null);
Modified: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java?rev=888041&r1=888040&r2=888041&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java (original)
+++ lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java Mon Dec 7 17:40:36 2009
@@ -316,7 +316,7 @@
// increase number of iterations for more complete testing
- for (int i=0; i<1000; i++) {
+ for (int i=0; i<50; i++) {
int lev = rnd.nextInt(maxLev);
final long seed = rnd.nextLong();
BooleanQuery q1 = TestBoolean2.randBoolQuery(new Random(seed), true, lev, field, vals, null);
@@ -331,10 +331,10 @@
// will not normalize scores.
TopDocs top1 = s.search(q1,null,100);
TopDocs top2 = s.search(q2,null,100);
-
- QueryUtils.check(q1,s);
- QueryUtils.check(q2,s);
-
+ if (i < 100) {
+ QueryUtils.check(q1,s);
+ QueryUtils.check(q2,s);
+ }
// The constrained query
// should be a superset to the unconstrained query.
if (top2.totalHits > top1.totalHits) {
Modified: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java?rev=888041&r1=888040&r2=888041&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java (original)
+++ lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java Mon Dec 7 17:40:36 2009
@@ -229,7 +229,7 @@
final Random rnd=newRandom();
String field="field"+precisionStep;
int termCountT=0,termCountC=0;
- for (int i=0; i<50; i++) {
+ for (int i=0; i<10; i++) {
int lower=(int)(rnd.nextDouble()*noDocs*distance)+startOffset;
int upper=(int)(rnd.nextDouble()*noDocs*distance)+startOffset;
if (lower>upper) {
@@ -272,8 +272,8 @@
assertEquals("Total number of terms should be equal for unlimited precStep", termCountT, termCountC);
} else {
System.out.println("Average number of terms during random search on '" + field + "':");
- System.out.println(" Trie query: " + (((double)termCountT)/(50*4)));
- System.out.println(" Classical query: " + (((double)termCountC)/(50*4)));
+ System.out.println(" Trie query: " + (((double)termCountT)/(10*4)));
+ System.out.println(" Classical query: " + (((double)termCountC)/(10*4)));
}
}
@@ -296,8 +296,8 @@
private void testRangeSplit(int precisionStep) throws Exception {
final Random rnd=newRandom();
String field="ascfield"+precisionStep;
- // 50 random tests
- for (int i=0; i<50; i++) {
+ // 10 random tests
+ for (int i=0; i<10; i++) {
int lower=(int)(rnd.nextDouble()*noDocs - noDocs/2);
int upper=(int)(rnd.nextDouble()*noDocs - noDocs/2);
if (lower>upper) {
Modified: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestNumericRangeQuery64.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestNumericRangeQuery64.java?rev=888041&r1=888040&r2=888041&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestNumericRangeQuery64.java (original)
+++ lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestNumericRangeQuery64.java Mon Dec 7 17:40:36 2009
@@ -244,7 +244,7 @@
final Random rnd=newRandom();
String field="field"+precisionStep;
int termCountT=0,termCountC=0;
- for (int i=0; i<50; i++) {
+ for (int i=0; i<10; i++) {
long lower=(long)(rnd.nextDouble()*noDocs*distance)+startOffset;
long upper=(long)(rnd.nextDouble()*noDocs*distance)+startOffset;
if (lower>upper) {
@@ -287,8 +287,8 @@
assertEquals("Total number of terms should be equal for unlimited precStep", termCountT, termCountC);
} else {
System.out.println("Average number of terms during random search on '" + field + "':");
- System.out.println(" Trie query: " + (((double)termCountT)/(50*4)));
- System.out.println(" Classical query: " + (((double)termCountC)/(50*4)));
+ System.out.println(" Trie query: " + (((double)termCountT)/(10*4)));
+ System.out.println(" Classical query: " + (((double)termCountC)/(10*4)));
}
}
@@ -315,8 +315,8 @@
private void testRangeSplit(int precisionStep) throws Exception {
final Random rnd=newRandom();
String field="ascfield"+precisionStep;
- // 50 random tests
- for (int i=0; i<50; i++) {
+ // 10 random tests
+ for (int i=0; i<10; i++) {
long lower=(long)(rnd.nextDouble()*noDocs - noDocs/2);
long upper=(long)(rnd.nextDouble()*noDocs - noDocs/2);
if (lower>upper) {
Modified: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java?rev=888041&r1=888040&r2=888041&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java (original)
+++ lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java Mon Dec 7 17:40:36 2009
@@ -40,7 +40,7 @@
* and (3) a sanity test with multiple searching threads.
*/
public class TestTimeLimitingCollector extends LuceneTestCase {
- private static final int SLOW_DOWN = 47;
+ private static final int SLOW_DOWN = 3;
private static final long TIME_ALLOWED = 17 * SLOW_DOWN; // so searches can find about 17 docs.
// max time allowed is relaxed for multithreading tests.
Modified: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/function/TestCustomScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/function/TestCustomScoreQuery.java?rev=888041&r1=888040&r2=888041&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/function/TestCustomScoreQuery.java (original)
+++ lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/search/function/TestCustomScoreQuery.java Mon Dec 7 17:40:36 2009
@@ -206,7 +206,13 @@
assertEquals("queries should have same #hits",h1.size(),h3CustomMul.size());
assertEquals("queries should have same #hits",h1.size(),h4CustomAdd.size());
assertEquals("queries should have same #hits",h1.size(),h5CustomMulAdd.size());
-
+
+ QueryUtils.check(q1,s);
+ QueryUtils.check(q2,s);
+ QueryUtils.check(q3,s);
+ QueryUtils.check(q4,s);
+ QueryUtils.check(q5,s);
+
// verify scores ratios
for (Iterator it = h1.keySet().iterator(); it.hasNext();) {
Integer x = (Integer) it.next();
@@ -240,7 +246,6 @@
}
private void logResult(String msg, IndexSearcher s, Query q, int doc, float score1) throws IOException {
- QueryUtils.check(q,s);
log(msg+" "+score1);
log("Explain by: "+q);
log(s.explain(q,doc));
Modified: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/store/TestBufferedIndexInput.java?rev=888041&r1=888040&r2=888041&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/store/TestBufferedIndexInput.java (original)
+++ lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/store/TestBufferedIndexInput.java Mon Dec 7 17:40:36 2009
@@ -58,7 +58,7 @@
}
}
- private static final long TEST_FILE_LENGTH = 1024*1024;
+ private static final long TEST_FILE_LENGTH = 100*1024;
// Call readByte() repeatedly, past the buffer boundary, and see that it
// is working as expected.
@@ -94,15 +94,10 @@
// run test with chunk size of 10 bytes
runReadBytesAndClose(new SimpleFSIndexInput(tmpInputFile,
inputBufferSize, 10), inputBufferSize, r);
- // run test with chunk size of 100 MB - default
- runReadBytesAndClose(new SimpleFSIndexInput(tmpInputFile,
- inputBufferSize, FSDirectory.DEFAULT_READ_CHUNK_SIZE), inputBufferSize, r);
+
// run test with chunk size of 10 bytes
runReadBytesAndClose(new NIOFSIndexInput(tmpInputFile,
inputBufferSize, 10), inputBufferSize, r);
- // run test with chunk size of 100 MB - default
- runReadBytesAndClose(new NIOFSIndexInput(tmpInputFile,
- inputBufferSize, FSDirectory.DEFAULT_READ_CHUNK_SIZE), inputBufferSize, r);
}
private void runReadBytesAndClose(IndexInput input, int bufferSize, Random r)
@@ -129,7 +124,7 @@
}
}
// wildly fluctuating size:
- for (long i = 0; i < 1000; i++) {
+ for (long i = 0; i < 100; i++) {
final int size = r.nextInt(10000);
checkReadBytes(input, 1+size, pos);
pos += 1+size;
@@ -172,10 +167,10 @@
}
}
- // This tests that attempts to readBytes() past an EOF will fail, while
- // reads up to the EOF will succeed. The EOF is determined by the
- // BufferedIndexInput's arbitrary length() value.
- public void testEOF() throws Exception {
+ // This tests that attempts to readBytes() past an EOF will fail, while
+ // reads up to the EOF will succeed. The EOF is determined by the
+ // BufferedIndexInput's arbitrary length() value.
+ public void testEOF() throws Exception {
MyBufferedIndexInput input = new MyBufferedIndexInput(1024);
// see that we can read all the bytes at one go:
checkReadBytes(input, (int)input.length(), 0);
@@ -223,25 +218,25 @@
// an infinite file
this(Long.MAX_VALUE);
}
- @Override
- protected void readInternal(byte[] b, int offset, int length) throws IOException {
- for(int i=offset; i<offset+length; i++)
- b[i] = byten(pos++);
- }
+ @Override
+ protected void readInternal(byte[] b, int offset, int length) throws IOException {
+ for(int i=offset; i<offset+length; i++)
+ b[i] = byten(pos++);
+ }
- @Override
- protected void seekInternal(long pos) throws IOException {
- this.pos = pos;
- }
+ @Override
+ protected void seekInternal(long pos) throws IOException {
+ this.pos = pos;
+ }
- @Override
- public void close() throws IOException {
- }
+ @Override
+ public void close() throws IOException {
+ }
- @Override
- public long length() {
- return len;
- }
+ @Override
+ public long length() {
+ return len;
+ }
}
public void testSetBufferSize() throws IOException {
Modified: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/util/LuceneTestCase.java?rev=888041&r1=888040&r2=888041&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/util/LuceneTestCase.java (original)
+++ lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/util/LuceneTestCase.java Mon Dec 7 17:40:36 2009
@@ -24,7 +24,6 @@
import junit.framework.TestCase;
-import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.index.ConcurrentMergeScheduler;
import org.apache.lucene.search.FieldCache;
import org.apache.lucene.search.FieldCache.CacheEntry;
@@ -203,6 +202,7 @@
@Override
public void runBare() throws Throwable {
+ //long t0 = System.currentTimeMillis();
try {
seed = null;
super.runBare();
@@ -212,6 +212,8 @@
}
throw e;
}
+ //long t = System.currentTimeMillis() - t0;
+ //System.out.println(t + " msec for " + getName());
}
// recorded seed
Propchange: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/util/TestAttributeSource.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Dec 7 17:40:36 2009
@@ -2,4 +2,4 @@
/lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/util/TestAttributeSource.java:817269-818600,825998,829134,829881,831036
/lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/util/TestAttributeSource.java:818601-821336
/lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/util/TestAttributeSource.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/trunk/src/test/org/apache/lucene/util/TestAttributeSource.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,883079
+/lucene/java/trunk/src/test/org/apache/lucene/util/TestAttributeSource.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,883079,885214
Modified: lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/util/TestIndexableBinaryStringTools.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/util/TestIndexableBinaryStringTools.java?rev=888041&r1=888040&r2=888041&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/util/TestIndexableBinaryStringTools.java (original)
+++ lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/util/TestIndexableBinaryStringTools.java Mon Dec 7 17:40:36 2009
@@ -22,7 +22,7 @@
import java.nio.ByteBuffer;
public class TestIndexableBinaryStringTools extends LuceneTestCase {
- private static final int NUM_RANDOM_TESTS = 20000;
+ private static final int NUM_RANDOM_TESTS = 2000;
private static final int MAX_RANDOM_BINARY_LENGTH = 300;
public void testSingleBinaryRoundTrip() {