You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by sy...@apache.org on 2016/10/02 14:35:37 UTC

[19/50] [abbrv] lucenenet git commit: Fixed bugs in Suggest.Spell.TestSpellChecker.TestConcurrentAccess that caused it to fail.

Fixed bugs in Suggest.Spell.TestSpellChecker.TestConcurrentAccess that caused it to fail.


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/fab36bc4
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/fab36bc4
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/fab36bc4

Branch: refs/heads/master
Commit: fab36bc49f3acbce3dff9067ed80a539837d005c
Parents: d77e632
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Fri Sep 16 02:49:32 2016 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Sun Oct 2 17:44:32 2016 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Tests.Suggest/Spell/TestSpellChecker.cs | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fab36bc4/src/Lucene.Net.Tests.Suggest/Spell/TestSpellChecker.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Suggest/Spell/TestSpellChecker.cs b/src/Lucene.Net.Tests.Suggest/Spell/TestSpellChecker.cs
index 49a4dab..346d1ae 100644
--- a/src/Lucene.Net.Tests.Suggest/Spell/TestSpellChecker.cs
+++ b/src/Lucene.Net.Tests.Suggest/Spell/TestSpellChecker.cs
@@ -294,7 +294,7 @@ namespace Lucene.Net.Search.Spell
         private void CheckLevenshteinSuggestions(IndexReader r)
         {
             // test small word
-            string[] 
+            string[]
             similar = spellChecker.SuggestSimilar("fvie", 2);
             assertEquals(1, similar.Length);
             assertEquals(similar[0], "five");
@@ -504,7 +504,7 @@ namespace Lucene.Net.Search.Spell
 
                 for (int i = 0; i < workers.Length; i++)
                 {
-                    assertFalse(string.Format(CultureInfo.InvariantCulture, "worker thread {0} failed \n" + workers[i].Error.ToString(), i), workers[i].Error == null);
+                    assertFalse(string.Format(CultureInfo.InvariantCulture, "worker thread {0} failed \n" + workers[i].Error, i), workers[i].Error != null);
                     assertTrue(string.Format(CultureInfo.InvariantCulture, "worker thread {0} is still running but should be terminated", i), workers[i].terminated);
                 }
                 // 4 searchers more than iterations
@@ -587,10 +587,15 @@ namespace Lucene.Net.Search.Spell
 
                             Thread.Sleep(10);// don't starve refresh()'s CPU, which sleeps every 50 bytes for 1 ms
                         }
+                        catch (AlreadyClosedException e)
+                        {
+                            return;
+                        }
                         catch (Exception e)
                         {
+                            e.printStackTrace();
                             error = e;
-                            stop.Set(true);
+                            return;
                         }
                     }
                 }