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:12 UTC
[lucene-solr] branch branch_8x 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 branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/branch_8x by this push:
new edbb21c Ensure nightly doesn't cause timeouts
edbb21c is described below
commit edbb21c548407be6281cd15612bc95d1025344c5
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 686e1d1..98cc697 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);