From 92d3ef3462d2c0494271c3802576a33e41bca9c1 Mon Sep 17 00:00:00 2001 From: Yonik Seeley Date: Fri, 4 Sep 2015 16:44:17 +0000 Subject: [PATCH] SOLR-8007: tests: fix TestSearcherReuse by avoiding background merges git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1701291 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/test/org/apache/solr/search/TestSearcherReuse.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/solr/core/src/test/org/apache/solr/search/TestSearcherReuse.java b/solr/core/src/test/org/apache/solr/search/TestSearcherReuse.java index af64613a1b5..c11153b081d 100644 --- a/solr/core/src/test/org/apache/solr/search/TestSearcherReuse.java +++ b/solr/core/src/test/org/apache/solr/search/TestSearcherReuse.java @@ -89,7 +89,10 @@ public class TestSearcherReuse extends SolrTestCaseJ4 { assertU(commit()); } } - assertU(commit()); + + // with random merge policies, a regular commit can cause a segment to be flushed that can kick off a background merge + // that can cause a later commit to actually see changes and open a new searcher. This should not be possible with optimize + assertU(optimize()); // seed a single query into the cache assertQ(req("*:*"), "//*[@numFound='"+numDocs+"']");