You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by si...@apache.org on 2020/05/08 05:18:56 UTC
[lucene-solr] branch master updated: Ensure nightly doesn't cause
timeouts
This is an automated email from the ASF dual-hosted git repository.
simonw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/master by this push:
new caa2042 Ensure nightly doesn't cause timeouts
caa2042 is described below
commit caa2042ff234c3a6bf10c336b99090d8985c7fb1
Author: Simon Willnauer <si...@apache.org>
AuthorDate: Fri May 8 07:15:58 2020 +0200
Ensure nightly doesn't cause timeouts
TestIndexWriterReader#testDuringAddDelete times out
if nightly hits a configuration that causes tons of flushes
with combination of SMS. This change disables auto-flush for this
test on nightly since it already produces lots of segments by definion.
---
.../org/apache/lucene/index/TestIndexWriterReader.java | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java
index 5f8650f..228c343 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java
@@ -809,11 +809,16 @@ public class TestIndexWriterReader extends LuceneTestCase {
// Stress test reopen during add/delete
public void testDuringAddDelete() throws Exception {
Directory dir1 = newDirectory();
+ IndexWriterConfig iwc = newIndexWriterConfig(new MockAnalyzer(random()))
+ .setMergePolicy(newLogMergePolicy(2));
+ if (TEST_NIGHTLY) {
+ // if we have a ton of iterations we need to make sure we don't do unnecessary
+ // extra flushing otherwise we will timeout on nightly
+ iwc.setRAMBufferSizeMB(IndexWriterConfig.DEFAULT_RAM_BUFFER_SIZE_MB);
+ iwc.setMaxBufferedDocs(IndexWriterConfig.DISABLE_AUTO_FLUSH);
+ }
final IndexWriter writer = new IndexWriter(
- dir1,
- newIndexWriterConfig(new MockAnalyzer(random()))
- .setMergePolicy(newLogMergePolicy(2))
- );
+ dir1,iwc);
// create the index
createIndexNoClose(false, "test", writer);
@@ -822,7 +827,7 @@ public class TestIndexWriterReader extends LuceneTestCase {
DirectoryReader r = writer.getReader();
final int iters = TEST_NIGHTLY ? 1000 : 10;
- final List<Throwable> excs = Collections.synchronizedList(new ArrayList<Throwable>());
+ final List<Throwable> excs = Collections.synchronizedList(new ArrayList<>());
final Thread[] threads = new Thread[numThreads];
final AtomicInteger remainingThreads = new AtomicInteger(numThreads);