lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [lucenenet] 10/12: Removed Timeout attribute from tests that are known to run in a short time, and deleted the (pointless) HasTimeoutAttribute
Date Thu, 11 Jul 2019 15:43:05 GMT
This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit b73217f7e1a558c571f1643c1060dbdbb8425caa
Author: Shad Storhaug <shad@shadstorhaug.com>
AuthorDate: Thu Jul 11 16:49:24 2019 +0700

    Removed Timeout attribute from tests that are known to run in a short time, and deleted
the (pointless) HasTimeoutAttribute
---
 .../Attributes/HasTimeoutAttribute.cs              | 38 ----------------------
 .../Index/BaseStoredFieldsFormatTestCase.cs        |  4 +--
 .../Index/BaseTermVectorsFormatTestCase.cs         |  2 +-
 .../Analysis/Th/TestThaiAnalyzer.cs                |  4 +--
 .../SimpleText/TestSimpleTextStoredFieldsFormat.cs | 12 ++-----
 .../SimpleText/TestSimpleTextTermVectorsFormat.cs  |  6 +---
 src/Lucene.Net.Tests/Search/TestScorerPerf.cs      |  6 +---
 src/Lucene.Net.Tests/TestWorstCaseTestBehavior.cs  | 12 ++-----
 8 files changed, 11 insertions(+), 73 deletions(-)

diff --git a/src/Lucene.Net.TestFramework/Attributes/HasTimeoutAttribute.cs b/src/Lucene.Net.TestFramework/Attributes/HasTimeoutAttribute.cs
deleted file mode 100644
index 92fc42b..0000000
--- a/src/Lucene.Net.TestFramework/Attributes/HasTimeoutAttribute.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-using NUnit.Framework;
-
-namespace Lucene.Net.Attributes
-{
-    /// <summary>
-    /// Specifies that this test sometimes runs for a long time and may not end.
-    /// For running tests in .NET Core because NUnit does not support [Timeout],
-    /// so we can have tests in the .NET Core build that run forever.
-    /// </summary>
-    public class HasTimeoutAttribute : CategoryAttribute
-    {
-        public HasTimeoutAttribute() : base("HasTimeout")
-        {
-            // nothing to do here but invoke the base contsructor.
-        }
-    }
-}
diff --git a/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
index 6261fe2..5c1caf9 100644
--- a/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
@@ -423,7 +423,7 @@ namespace Lucene.Net.Index
             dir.Dispose();
         }
 
-        // [Test, Timeout(300000)] // LUCENENET NOTE: For now, we are overriding this test
in every subclass to pull it into the right context for the subclass
+        // [Test] // LUCENENET NOTE: For now, we are overriding this test in every subclass
to pull it into the right context for the subclass
         public virtual void TestEmptyDocs()
         {
             Directory dir = NewDirectory();
@@ -452,7 +452,7 @@ namespace Lucene.Net.Index
             dir.Dispose();
         }
 
-        // [Test, Timeout(300000)] // LUCENENET NOTE: For now, we are overriding this test
in every subclass to pull it into the right context for the subclass
+        // [Test] // LUCENENET NOTE: For now, we are overriding this test in every subclass
to pull it into the right context for the subclass
         public virtual void TestConcurrentReads()
         {
             Directory dir = NewDirectory();
diff --git a/src/Lucene.Net.TestFramework/Index/BaseTermVectorsFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BaseTermVectorsFormatTestCase.cs
index f4ca43b..3cbc565 100644
--- a/src/Lucene.Net.TestFramework/Index/BaseTermVectorsFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BaseTermVectorsFormatTestCase.cs
@@ -759,7 +759,7 @@ namespace Lucene.Net.Index
             }
         }
 
-        // [Test, Timeout(300000)] // LUCENENET NOTE: For now, we are overriding this test
in every subclass to pull it into the right context for the subclass
+        // [Test] // LUCENENET NOTE: For now, we are overriding this test in every subclass
to pull it into the right context for the subclass
         // different options for the same field
         public virtual void TestMixedOptions()
         {
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiAnalyzer.cs
index 6231511..56d8404 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiAnalyzer.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiAnalyzer.cs
@@ -135,7 +135,7 @@ namespace Lucene.Net.Analysis.Th
          // LUCENENET: There is no Timeout on NUnit for .NET Core.		
          [Timeout(120000)] // LUCENENET TODO: Sometimes doesn't finish on .NET 4.5.1		
 #endif
-        [Test, HasTimeout]
+        [Test]
         public virtual void TestRandomStrings()
         {
 #if NETSTANDARD
@@ -151,7 +151,7 @@ namespace Lucene.Net.Analysis.Th
          // LUCENENET: There is no Timeout on NUnit for .NET Core.		
          [Timeout(120000)] // LUCENENET TODO: Sometimes doesn't finish on .NET 4.5.1		
 #endif
-        [Test, HasTimeout]
+        [Test]
         public virtual void TestRandomHugeStrings()
         {
 #if NETSTANDARD
diff --git a/src/Lucene.Net.Tests.Codecs/SimpleText/TestSimpleTextStoredFieldsFormat.cs b/src/Lucene.Net.Tests.Codecs/SimpleText/TestSimpleTextStoredFieldsFormat.cs
index 17c8741..9212c91 100644
--- a/src/Lucene.Net.Tests.Codecs/SimpleText/TestSimpleTextStoredFieldsFormat.cs
+++ b/src/Lucene.Net.Tests.Codecs/SimpleText/TestSimpleTextStoredFieldsFormat.cs
@@ -75,21 +75,13 @@ namespace Lucene.Net.Codecs.SimpleText
             base.TestReadSkip();
         }
 
-#if !NETSTANDARD
-        // LUCENENET: There is no Timeout on NUnit for .NET Core.
-        [Timeout(300000)]
-#endif
-        [Test, HasTimeout]
+        [Test]
         public override void TestEmptyDocs()
         {
             base.TestEmptyDocs();
         }
 
-#if !NETSTANDARD
-        // LUCENENET: There is no Timeout on NUnit for .NET Core.
-        [Timeout(300000)]
-#endif
-        [Test, HasTimeout]
+        [Test]
         public override void TestConcurrentReads()
         {
             base.TestConcurrentReads();
diff --git a/src/Lucene.Net.Tests.Codecs/SimpleText/TestSimpleTextTermVectorsFormat.cs b/src/Lucene.Net.Tests.Codecs/SimpleText/TestSimpleTextTermVectorsFormat.cs
index 9701bae..697c9d4 100644
--- a/src/Lucene.Net.Tests.Codecs/SimpleText/TestSimpleTextTermVectorsFormat.cs
+++ b/src/Lucene.Net.Tests.Codecs/SimpleText/TestSimpleTextTermVectorsFormat.cs
@@ -56,11 +56,7 @@ namespace Lucene.Net.Codecs.SimpleText
             base.TestLotsOfFields();
         }
 
-#if !NETSTANDARD
-        // LUCENENET: There is no Timeout on NUnit for .NET Core.
-        [Timeout(300000)]
-#endif
-        [Test, HasTimeout]
+        [Test]
         // different options for the same field
         public override void TestMixedOptions()
         {
diff --git a/src/Lucene.Net.Tests/Search/TestScorerPerf.cs b/src/Lucene.Net.Tests/Search/TestScorerPerf.cs
index c42c850..0727904 100644
--- a/src/Lucene.Net.Tests/Search/TestScorerPerf.cs
+++ b/src/Lucene.Net.Tests/Search/TestScorerPerf.cs
@@ -392,11 +392,7 @@ namespace Lucene.Net.Search
             return ret;
         }
 
-#if !NETSTANDARD
-        // LUCENENET: There is no Timeout on NUnit for .NET Core.
-        [Timeout(20000)] // LUCENENET TODO: Sometimes doesn't finish
-#endif
-        [Test, HasTimeout]
+        [Test]
         public virtual void TestConjunctions()
         {
             // test many small sets... the bugs will be found on boundary conditions
diff --git a/src/Lucene.Net.Tests/TestWorstCaseTestBehavior.cs b/src/Lucene.Net.Tests/TestWorstCaseTestBehavior.cs
index 8c4e445..98d4ada 100644
--- a/src/Lucene.Net.Tests/TestWorstCaseTestBehavior.cs
+++ b/src/Lucene.Net.Tests/TestWorstCaseTestBehavior.cs
@@ -27,7 +27,7 @@ namespace Lucene.Net
 
     public class TestWorstCaseTestBehavior : LuceneTestCase
     {
-#if !NETSTANDARD
+#if !NETSTANDARD1_6
         [Ignore("Ignored in Lucene")]
         [Test]
         public virtual void TestThreadLeak()
@@ -130,11 +130,7 @@ namespace Lucene.Net
         }
 
         [Ignore("Ignored in Lucene")]
-#if !NETSTANDARD
-        // LUCENENET: There is no Timeout on NUnit for .NET Core.
-        [Timeout(500)]
-#endif
-        [Test, HasTimeout]
+        [Test]
         public virtual void TestTimeout()
         {
             Thread.Sleep(5000);
@@ -142,10 +138,6 @@ namespace Lucene.Net
 
 
         [Ignore("Ignored in Lucene")]
-#if !NETSTANDARD
-        // LUCENENET: There is no Timeout on NUnit for .NET Core.
-        [Timeout(1000)]
-#endif
         [Test]
         public virtual void TestZombie()
         {


Mime
View raw message