You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ds...@apache.org on 2023/06/29 23:04:37 UTC

[solr] branch main updated: SOLR-16744: fix flaky RandomizedTaggerTest (#1736)

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

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


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

commit b104f9174b8b4097e367b7a74027e0cd75b6c42c
Author: Pierre Salagnac <82...@users.noreply.github.com>
AuthorDate: Fri Jun 30 01:04:30 2023 +0200

    SOLR-16744: fix flaky RandomizedTaggerTest (#1736)
    
    
    
    Co-authored-by: Pierre Salagnac <ps...@salesforce.com>
---
 .../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());
     }