You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/02/22 13:00:57 UTC

[GitHub] [lucene-solr] rmuir commented on a change in pull request #2414: LUCENE-9800: Hunspell: put a time limit on suggestion calculation

rmuir commented on a change in pull request #2414:
URL: https://github.com/apache/lucene-solr/pull/2414#discussion_r580231403



##########
File path: lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Hunspell.java
##########
@@ -49,20 +51,25 @@
  * shared by multiple spell-checkers in different threads).
  */
 public class Hunspell {
+  static final long SUGGEST_TIME_LIMIT = 250;

Review comment:
       I don't want to make this complicated, but for test purposes can we make this tweakable (even via package private method?)
   
   I'm concerned about unit tests here being dependent on how fast the underlying system is, we don't want false failures. I have two concerns:
   1) suggester tests unrelated (to this feature) that might sporadically fail because the system happens to be slow. 
   2) suggester tests related to this feature that might sporadically fail because system is too fast.
   
   There's a number of ways to ensure the tests stay robust. For example, in case 1, if we could set a TimeoutPolicy.NO_TIMEOUT (or similar name), we'd never hit false failures, even if say jenkins machine was running with load average in the hundreds. 
   
   For case 2, where we really want to be 100% sure the timeout happens, even if it is on @mikemccand super-fast machine, it would be nice if we could set the limit to 0 (even if its a package-private setter just for testing or something). 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org