erikhatcher commented on code in PR #12249:
URL: https://github.com/apache/lucene/pull/12249#discussion_r1179514851


##########
lucene/core/src/test/org/apache/lucene/util/graph/TestGraphTokenStreamFiniteStrings.java:
##########
@@ -660,4 +661,27 @@ public void testMultipleSidePathsWithGaps() throws 
Exception {
         it.next(), new String[] {"king", "alfred", "saxons", "ruled"}, new 
int[] {1, 1, 3, 1});
     assertFalse(it.hasNext());
   }
+
+  public void testLongTokenStreamStackOverflowError() throws Exception {
+    ArrayList<Token> tokens =
+        new ArrayList<Token>() {
+          {
+            add(token("turbo", 1, 1));
+            add(token("fast", 0, 2));
+            add(token("charged", 1, 1));
+            add(token("wi", 1, 1));
+            add(token("wifi", 0, 2));
+            add(token("fi", 1, 1));
+          }
+        };
+
+    // Add in too many tokens to get a high depth graph
+    for (int i = 0; i < 1024 * 10; i++) {

Review Comment:
   would 1024 + 1 work instead of `* 10`?   Or rather, what's the minimum here 
needed to trigger the cutoff limit?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to