BUG: BUG: Lucene.Net.Tests.Util.TestFSTs.TestRandomWords(): Test causes NUnit to crash with OOM exception with verbosity enabled, so disabling verbosity by default and decreasing number of words from 1000 to 500 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/22c1d814 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/22c1d814 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/22c1d814 Branch: refs/heads/api-work Commit: 22c1d814d8af361b1e22e4b648a2f9760c4af1a5 Parents: cbafbfd Author: Shad Storhaug <[email protected]> Authored: Sun Mar 5 04:16:37 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Sun Mar 5 17:08:47 2017 +0700 ---------------------------------------------------------------------- src/Lucene.Net.Tests/Util/Fst/TestFSTs.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/22c1d814/src/Lucene.Net.Tests/Util/Fst/TestFSTs.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests/Util/Fst/TestFSTs.cs b/src/Lucene.Net.Tests/Util/Fst/TestFSTs.cs index a69292c..caa3b6c 100644 --- a/src/Lucene.Net.Tests/Util/Fst/TestFSTs.cs +++ b/src/Lucene.Net.Tests/Util/Fst/TestFSTs.cs @@ -273,8 +273,15 @@ namespace Lucene.Net.Util.Fst [Test, LongRunningTest, HasTimeout] // 45 minutes to be on the safe side public virtual void TestRandomWords() { - fail("This test is somehow crashing NUnit and causing it not to complete"); - TestRandomWords(1000, AtLeast(2)); + // 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 iterations by 9/10, which seems to + // keep it from crashing. + bool isVerbose = false; // Enable manually + int maxNumWords = isVerbose ? 500 : 1000; + + TestRandomWords(maxNumWords, AtLeast(2), isVerbose); //testRandomWords(100, 1); } @@ -290,7 +297,7 @@ namespace Lucene.Net.Util.Fst } } - private void TestRandomWords(int maxNumWords, int numIter) + private void TestRandomWords(int maxNumWords, int numIter, bool VERBOSE) { Random random = new Random(Random().Next()); for (int iter = 0; iter < numIter; iter++) @@ -318,7 +325,7 @@ namespace Lucene.Net.Util.Fst [Ignore("LUCENENET TODO: This test will take around 10-14 hours to finish. It was marked with a Nightly attribute in the original Java source, but we don't currently have a corresponding attribute")] public virtual void TestBigSet() { - TestRandomWords(TestUtil.NextInt(Random(), 50000, 60000), 1); + TestRandomWords(TestUtil.NextInt(Random(), 50000, 60000), 1, false); } // Build FST for all unique terms in the test line docs
