You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by mk...@apache.org on 2023/03/14 20:15:01 UTC

[solr] branch branch_9_2 updated: SOLR-16585: bypass empty update in the test(#1456)

This is an automated email from the ASF dual-hosted git repository.

mkhl pushed a commit to branch branch_9_2
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9_2 by this push:
     new 581e4b8d35a SOLR-16585: bypass empty update in the test(#1456)
581e4b8d35a is described below

commit 581e4b8d35ac7acc55c6bb49e6d3dcb24c469f00
Author: Mikhail Khludnev <mk...@users.noreply.github.com>
AuthorDate: Tue Mar 14 23:14:53 2023 +0300

    SOLR-16585: bypass empty update in the test(#1456)
---
 .../src/test/org/apache/solr/client/solrj/SolrExampleTests.java     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
index 3f5f82658de..b49199f5cd8 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
@@ -590,13 +590,15 @@ public abstract class SolrExampleTests extends SolrExampleTestsBase {
       doc.addField("name", "doc" + i);
       doc.addField("price", "" + i);
       docs.add(doc);
-      if (rarely()) {
+      if (rarely() && !docs.isEmpty()) {
         client.add(docs);
         client.commit();
         docs.clear();
       }
     }
-    client.add(docs);
+    if (!docs.isEmpty()) {
+      client.add(docs);
+    }
     if (random().nextBoolean()) {
       client.commit();
     } else {