From 04eac025b86d6c69f0f40fd8e9bb952f3970109a Mon Sep 17 00:00:00 2001 From: David Smiley Date: Sun, 26 Jan 2025 21:17:35 -0500 Subject: [PATCH] fix nocommit --- .../client/solrj/request/QueryRequest.java | 3 +- .../AbstractBasicDistributedZkTestBase.java | 60 +++++++++---------- 2 files changed, 31 insertions(+), 32 deletions(-) diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/QueryRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/QueryRequest.java index 850e524aa84..c8652fa3887 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/QueryRequest.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/QueryRequest.java @@ -20,7 +20,6 @@ import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.response.QueryResponse; import org.apache.solr.common.params.CommonParams; -import org.apache.solr.common.params.ModifiableSolrParams; import org.apache.solr.common.params.SolrParams; /** @@ -32,7 +31,7 @@ public class QueryRequest extends CollectionRequiringSolrRequest public QueryRequest() { super(METHOD.GET, null); - query = new ModifiableSolrParams(); // TODO SolrParams.of() + query = SolrParams.of(); } public QueryRequest(SolrParams q) { diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractBasicDistributedZkTestBase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractBasicDistributedZkTestBase.java index 9dea2eefcb1..0cf43b7bf8f 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractBasicDistributedZkTestBase.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractBasicDistributedZkTestBase.java @@ -722,36 +722,36 @@ protected void test() throws Exception { newSearcherHook.waitForSearcher(DEFAULT_COLLECTION, 2, 20000, false); assertSliceCounts("deleteById commitWithin did not work", before + 1, dColl); - // NOCOMMIT - // // try deleteByQuery commitWithin - // UpdateRequest deleteByQueryReq = new UpdateRequest(); - // deleteByQueryReq.deleteByQuery("id:301"); - // deleteByQueryReq.setCommitWithin(10); - // deleteByQueryReq.process(cloudClient); - // - // newSearcherHook.waitForSearcher(DEFAULT_COLLECTION, 2, 20000, false); - // - // assertSliceCounts("deleteByQuery commitWithin did not work", before, dColl); - // - // // TODO: This test currently fails because debug info is obtained only - // // on shards with matches. - // // query("q","matchesnothing","fl","*,score", "debugQuery", "true"); - // - // // would be better if these where all separate tests - but much, much - // // slower - // doOptimisticLockingAndUpdating(); - // testShardParamVariations(); - // testMultipleCollections(); - // testANewCollectionInOneInstance(); - // testSearchByCollectionName(); - // testUpdateByCollectionName(); - // testANewCollectionInOneInstanceWithManualShardAssignement(); - // testNumberOfCommitsWithCommitAfterAdd(); - // - // testUpdateProcessorsRunOnlyOnce("distrib-dup-test-chain-explicit"); - // testUpdateProcessorsRunOnlyOnce("distrib-dup-test-chain-implicit"); - // - // testStopAndStartCoresInOneInstance(); + + // try deleteByQuery commitWithin + UpdateRequest deleteByQueryReq = new UpdateRequest(); + deleteByQueryReq.deleteByQuery("id:301"); + deleteByQueryReq.setCommitWithin(10); + deleteByQueryReq.process(cloudClient); + + newSearcherHook.waitForSearcher(DEFAULT_COLLECTION, 2, 20000, false); + + assertSliceCounts("deleteByQuery commitWithin did not work", before, dColl); + + // TODO: This test currently fails because debug info is obtained only + // on shards with matches. + // query("q","matchesnothing","fl","*,score", "debugQuery", "true"); + + // would be better if these where all separate tests - but much, much + // slower + doOptimisticLockingAndUpdating(); + testShardParamVariations(); + testMultipleCollections(); + testANewCollectionInOneInstance(); + testSearchByCollectionName(); + testUpdateByCollectionName(); + testANewCollectionInOneInstanceWithManualShardAssignement(); + testNumberOfCommitsWithCommitAfterAdd(); + + testUpdateProcessorsRunOnlyOnce("distrib-dup-test-chain-explicit"); + testUpdateProcessorsRunOnlyOnce("distrib-dup-test-chain-implicit"); + + testStopAndStartCoresInOneInstance(); } private void testSortableTextFaceting() throws Exception {