lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [36/50] [abbrv] lucenenet git commit: BUG: Lucene.Net.Tests.Search.TestTopDocsMerge (TestSort_1() + TestSort_2()): Tests cause NUnit to crash with OOM exception with verbosity enabled, so disabling verbosity by default and decreasing number of fields fro
Date Sun, 05 Mar 2017 11:49:15 GMT
BUG: Lucene.Net.Tests.Search.TestTopDocsMerge (TestSort_1() + TestSort_2()): Tests cause NUnit
to crash with OOM exception with verbosity enabled, so disabling verbosity by default and
decreasing number of fields from 1000 to 50 if verbosity is enabled.


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

Branch: refs/heads/api-work
Commit: cbafbfd1ae81e9f4e65869cd491ba2bb5334db3c
Parents: 5dd512b
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sun Mar 5 04:14:12 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Sun Mar 5 17:08:46 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Tests/Search/TestTopDocsMerge.cs | 29 ++++++++++++++++----
 1 file changed, 23 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cbafbfd1/src/Lucene.Net.Tests/Search/TestTopDocsMerge.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Search/TestTopDocsMerge.cs b/src/Lucene.Net.Tests/Search/TestTopDocsMerge.cs
index 8551352..1099e20 100644
--- a/src/Lucene.Net.Tests/Search/TestTopDocsMerge.cs
+++ b/src/Lucene.Net.Tests/Search/TestTopDocsMerge.cs
@@ -73,23 +73,40 @@ namespace Lucene.Net.Search
         [Test]
         public virtual void TestSort_1()
         {
-            fail("This test deadlocks when other tests in Lucene.Net.Tests are run at the
same time (need to investigate which ones and why)");
-            TestSort(false);
+            // LUCENENET specific: NUnit will crash with an OOM if we do the full test
+            // with verbosity enabled. So, making this a manual setting that can be
+            // turned on if, and only if, needed for debugging. If the setting is turned
+            // on, we are decresing the number of docs to 50, which seems to
+            // keep it from crashing.
+            bool isVerbose = false;
+
+            TestSort(false, isVerbose);
         }
 
         [Test]
         public virtual void TestSort_2()
         {
-            fail("This test deadlocks when other tests in Lucene.Net.Tests are run at the
same time (need to investigate which ones and why)");
-            TestSort(true);
+            // LUCENENET specific: NUnit will crash with an OOM if we do the full test
+            // with verbosity enabled. So, making this a manual setting that can be
+            // turned on if, and only if, needed for debugging. If the setting is turned
+            // on, we are decresing the number of docs to 50, which seems to
+            // keep it from crashing.
+            bool isVerbose = false;
+
+            TestSort(true, isVerbose);
         }
 
-        internal virtual void TestSort(bool useFrom)
+        internal virtual void TestSort(bool useFrom, bool VERBOSE)
         {
             IndexReader reader = null;
             Directory dir = null;
 
-            int numDocs = AtLeast(1000);
+            if (!VERBOSE)
+            {
+                Console.WriteLine("Verbosity disabled. Enable manually if needed.");
+            }
+
+            int numDocs = VERBOSE ? AtLeast(50) : AtLeast(1000);
             //final int numDocs = AtLeast(50);
 
             string[] tokens = new string[] { "a", "b", "c", "d", "e" };


Mime
View raw message