mirror of https://github.com/apache/lucene.git
fix silly test bugs (thanks selckin!)
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1136357 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
aa6966782f
commit
38b838b25a
|
@ -502,12 +502,12 @@ public class TestNRTManager extends LuceneTestCase {
|
|||
int seenTermCount = 0;
|
||||
int shift;
|
||||
int trigger;
|
||||
if (totTermCount.get() == 0) {
|
||||
if (totTermCount.get() < 10) {
|
||||
shift = 0;
|
||||
trigger = 1;
|
||||
} else {
|
||||
shift = random.nextInt(totTermCount.get()/10);
|
||||
trigger = totTermCount.get()/10;
|
||||
shift = random.nextInt(trigger);
|
||||
}
|
||||
|
||||
while(System.currentTimeMillis() < stopTime) {
|
||||
|
@ -518,13 +518,13 @@ public class TestNRTManager extends LuceneTestCase {
|
|||
}
|
||||
totTermCount.set(seenTermCount);
|
||||
seenTermCount = 0;
|
||||
if (totTermCount.get() == 0) {
|
||||
if (totTermCount.get() < 10) {
|
||||
shift = 0;
|
||||
trigger = 1;
|
||||
} else {
|
||||
trigger = totTermCount.get()/10;
|
||||
//System.out.println("trigger " + trigger);
|
||||
shift = random.nextInt(totTermCount.get()/10);
|
||||
shift = random.nextInt(trigger);
|
||||
}
|
||||
termsEnum.seek(new BytesRef(""));
|
||||
continue;
|
||||
|
|
|
@ -411,24 +411,24 @@ public class TestNRTThreads extends LuceneTestCase {
|
|||
int seenTermCount = 0;
|
||||
int shift;
|
||||
int trigger;
|
||||
if (totTermCount.get() == 0) {
|
||||
if (totTermCount.get() < 10) {
|
||||
shift = 0;
|
||||
trigger = 1;
|
||||
} else {
|
||||
shift = random.nextInt(totTermCount.get()/10);
|
||||
trigger = totTermCount.get()/10;
|
||||
shift = random.nextInt(trigger);
|
||||
}
|
||||
while(System.currentTimeMillis() < searchStopTime) {
|
||||
BytesRef term = termsEnum.next();
|
||||
if (term == null) {
|
||||
if (seenTermCount == 0) {
|
||||
if (seenTermCount < 10) {
|
||||
break;
|
||||
}
|
||||
totTermCount.set(seenTermCount);
|
||||
seenTermCount = 0;
|
||||
trigger = totTermCount.get()/10;
|
||||
//System.out.println("trigger " + trigger);
|
||||
shift = random.nextInt(totTermCount.get()/10);
|
||||
shift = random.nextInt(trigger);
|
||||
termsEnum.seek(new BytesRef(""));
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue