Lucene.Net.Benchmark.ByTask.Feeds.EnwikiContentSource: Fixed concurrency bugs 
that were causing tests not to finish


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

Branch: refs/heads/master
Commit: a60c5ef4d1c2e4f617fc732cdcf42f3df2a15a83
Parents: b515271
Author: Shad Storhaug <s...@shadstorhaug.com>
Authored: Tue Aug 1 08:08:19 2017 +0700
Committer: Shad Storhaug <s...@shadstorhaug.com>
Committed: Wed Aug 2 09:55:04 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Benchmark/ByTask/Feeds/EnwikiContentSource.cs   | 6 +++---
 .../ByTask/Feeds/EnwikiContentSourceTest.cs                    | 1 -
 2 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a60c5ef4/src/Lucene.Net.Benchmark/ByTask/Feeds/EnwikiContentSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Benchmark/ByTask/Feeds/EnwikiContentSource.cs 
b/src/Lucene.Net.Benchmark/ByTask/Feeds/EnwikiContentSource.cs
index c9db5a2..2cb24d0 100644
--- a/src/Lucene.Net.Benchmark/ByTask/Feeds/EnwikiContentSource.cs
+++ b/src/Lucene.Net.Benchmark/ByTask/Feeds/EnwikiContentSource.cs
@@ -68,7 +68,7 @@ namespace Lucene.Net.Benchmarks.ByTask.Feeds
                 if (t == null)
                 {
                     threadDone = false;
-                    t = new ThreadClass(/*this*/);
+                    t = new ThreadClass(Run);
                     t.SetDaemon(true);
                     t.Start();
                 }
@@ -165,7 +165,7 @@ namespace Lucene.Net.Benchmarks.ByTask.Feeds
                     case BODY:
                         body = contents.ToString();
                         //workaround that startswith doesn't have an ignore 
case option, get at least 20 chars.
-                        string startsWith = body.Substring(0, Math.Min(10, 
contents.Length)).ToLowerInvariant();
+                        string startsWith = body.Substring(0, Math.Min(10, 
contents.Length) - 0).ToLowerInvariant();
                         if (startsWith.StartsWith("#redirect", 
StringComparison.Ordinal))
                         {
                             body = null;
@@ -195,7 +195,7 @@ namespace Lucene.Net.Benchmarks.ByTask.Feeds
 
                 try
                 {
-                    Sax.Net.IXmlReader reader = 
XmlReaderFactory.Current.CreateXmlReader(); 
//XMLReaderFactory.createXMLReader();
+                    Sax.Net.IXmlReader reader = new 
TagSoup.Net.XmlReaderFactory().CreateXmlReader(); 
//XMLReaderFactory.createXMLReader();
                     reader.ContentHandler = this;
                     reader.ErrorHandler = this;
                     while (!stopped)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a60c5ef4/src/Lucene.Net.Tests.Benchmark/ByTask/Feeds/EnwikiContentSourceTest.cs
----------------------------------------------------------------------
diff --git 
a/src/Lucene.Net.Tests.Benchmark/ByTask/Feeds/EnwikiContentSourceTest.cs 
b/src/Lucene.Net.Tests.Benchmark/ByTask/Feeds/EnwikiContentSourceTest.cs
index 95ded38..220d75e 100644
--- a/src/Lucene.Net.Tests.Benchmark/ByTask/Feeds/EnwikiContentSourceTest.cs
+++ b/src/Lucene.Net.Tests.Benchmark/ByTask/Feeds/EnwikiContentSourceTest.cs
@@ -26,7 +26,6 @@ namespace Lucene.Net.Benchmarks.ByTask.Feeds
      * limitations under the License.
      */
 
-    [Ignore("LUCENENET TODO: Never finishes")]
     public class EnwikiContentSourceTest : LuceneTestCase
     {
         /** An EnwikiContentSource which works on a String and not files. */

Reply via email to