lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [11/50] [abbrv] lucenenet git commit: Added missing random task scheduler to LuceneTestCase.NewSearcher()
Date Sun, 23 Oct 2016 13:01:57 GMT
Added missing random task scheduler to LuceneTestCase.NewSearcher()


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

Branch: refs/heads/master
Commit: 1e1a5006e9aff68001c1cfb4c7f5533564a1197b
Parents: 4c54ef2
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sun Oct 16 08:13:44 2016 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Thu Oct 20 18:20:53 2016 +0700

----------------------------------------------------------------------
 .../Util/LuceneTestCase.cs                         | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1e1a5006/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
index 87f0edb..186bc0e 100644
--- a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
@@ -1704,25 +1704,26 @@ namespace Lucene.Net.Util
             {
                 int threads = 0;
                 TaskScheduler ex;
-                /*if (random.NextBoolean())
-                {*/
+                if (random.NextBoolean())
+                {
                 ex = null;
-                /*}
+                }
                 else
                 {
                     threads = TestUtil.NextInt(random, 1, 8);
-                    ex = new ThreadPoolExecutor(threads, threads, 0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<IThreadRunnable>(), new NamedThreadFactory("LuceneTestCase"));
+                    ex = new LimitedConcurrencyLevelTaskScheduler(threads);
+                    //ex = new ThreadPoolExecutor(threads, threads, 0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<IThreadRunnable>(), new NamedThreadFactory("LuceneTestCase"));
                     // uncomment to intensify LUCENE-3840
                     // ex.prestartAllCoreThreads();
-                }*/
-                /*if (ex != null)
+                }
+                if (ex != null)
                 {
                     if (VERBOSE)
                     {
                         Console.WriteLine("NOTE: newSearcher using ExecutorService with "
+ threads + " threads");
                     }
-                    r.AddReaderClosedListener(new ReaderClosedListenerAnonymousInnerClassHelper(ex));
-                }*/
+                    //r.AddReaderClosedListener(new ReaderClosedListenerAnonymousInnerClassHelper(ex));
+                }
                 IndexSearcher ret;
                 if (wrapWithAssertions)
                 {


Mime
View raw message