relax test a little bit

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1525231 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shai Erera 2013-09-21 13:10:18 +00:00
parent f6e125ce66
commit 243e614e52
1 changed files with 3 additions and 2 deletions

View File

@ -900,7 +900,6 @@ public class TestNumericDocValuesUpdates extends LuceneTestCase {
public void testStressMultiThreading() throws Exception { public void testStressMultiThreading() throws Exception {
final Directory dir = newDirectory(); final Directory dir = newDirectory();
IndexWriterConfig conf = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())); IndexWriterConfig conf = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()));
conf.setMaxBufferedDocs(2);
final IndexWriter writer = new IndexWriter(dir, conf); final IndexWriter writer = new IndexWriter(dir, conf);
// create index // create index
@ -930,12 +929,13 @@ public class TestNumericDocValuesUpdates extends LuceneTestCase {
for (int i = 0; i < threads.length; i++) { for (int i = 0; i < threads.length; i++) {
final String f = "f" + i; final String f = "f" + i;
final String cf = "cf" + i; final String cf = "cf" + i;
final int numThreadUpdates = atLeast(40);
threads[i] = new Thread("UpdateThread-" + i) { threads[i] = new Thread("UpdateThread-" + i) {
@Override @Override
public void run() { public void run() {
try { try {
int numUpdates = atLeast(40);
Random random = random(); Random random = random();
int numUpdates = numThreadUpdates;
while (numUpdates-- > 0) { while (numUpdates-- > 0) {
double group = random.nextDouble(); double group = random.nextDouble();
Term t; Term t;
@ -943,6 +943,7 @@ public class TestNumericDocValuesUpdates extends LuceneTestCase {
else if (group < 0.5) t = new Term("updKey", "g1"); else if (group < 0.5) t = new Term("updKey", "g1");
else if (group < 0.8) t = new Term("updKey", "g2"); else if (group < 0.8) t = new Term("updKey", "g2");
else t = new Term("updKey", "g3"); else t = new Term("updKey", "g3");
// System.out.println("[" + Thread.currentThread().getName() + "] numUpdates=" + numUpdates + " updateTerm=" + t);
long updValue = random.nextInt(); long updValue = random.nextInt();
writer.updateNumericDocValue(t, f, updValue); writer.updateNumericDocValue(t, f, updValue);
writer.updateNumericDocValue(t, cf, updValue * 2); writer.updateNumericDocValue(t, cf, updValue * 2);