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

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


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 1373beb50b7 SOLR-16744: fix flaky RandomizedTaggerTest (#1736)
1373beb50b7 is described below

commit 1373beb50b78249e274f923486058452905619bb
Author: Pierre Salagnac <[email protected]>
AuthorDate: Fri Jun 30 01:04:30 2023 +0200

    SOLR-16744: fix flaky RandomizedTaggerTest (#1736)
    
    
    
    Co-authored-by: Pierre Salagnac <[email protected]>
---
 .../test/org/apache/solr/handler/tagger/RandomizedTaggerTest.java  | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git 
a/solr/core/src/test/org/apache/solr/handler/tagger/RandomizedTaggerTest.java 
b/solr/core/src/test/org/apache/solr/handler/tagger/RandomizedTaggerTest.java
index 2b366f11311..e0d11111a7b 100644
--- 
a/solr/core/src/test/org/apache/solr/handler/tagger/RandomizedTaggerTest.java
+++ 
b/solr/core/src/test/org/apache/solr/handler/tagger/RandomizedTaggerTest.java
@@ -69,6 +69,13 @@ public class RandomizedTaggerTest extends TaggerTestCase {
         } else { // existing word (possible multi-word from prev iteration)
           buf.append(RandomPicks.randomFrom(R, names));
         }
+
+        // This loop has an exponential effect, because we add existing an 
name to a new name. In
+        // case we generate a too long name, the test will fail because of a 
too big automaton.
+        // Stop at 500 chars to prevent this.
+        if (buf.length() > 500) {
+          break;
+        }
       }
       names.add(buf.toString());
     }

Reply via email to