Harden TestExportWriter

force MergePolicy to ensure index order assumptions are valid

(cherry picked from commit 8a24641fb2)
This commit is contained in:
Chris Hostetter 2019-08-19 11:44:38 -07:00
parent f749bd7bc4
commit c324be4874
1 changed files with 4 additions and 1 deletions

View File

@ -34,6 +34,7 @@ import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.common.util.SuppressForbidden;
import org.apache.solr.common.util.Utils;
import org.apache.solr.index.LogDocMergePolicyFactory;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.schema.SchemaField;
import org.junit.Before;
@ -44,7 +45,9 @@ public class TestExportWriter extends SolrTestCaseJ4 {
@BeforeClass
public static void beforeClass() throws Exception {
System.setProperty("export.test", "true");
// force LogDocMergePolicy so that we get a predictable doc order
// when testing index order results
systemSetPropertySolrTestsMergePolicyFactory(LogDocMergePolicyFactory.class.getName());
initCore("solrconfig-sortingresponse.xml","schema-sortingresponse.xml");
}