You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2012/06/30 10:59:37 UTC

svn commit: r1355667 - in /lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/util: TestMaxFailuresRule.java junitcompat/TestSameRandomnessLocalePassedOrNot.java

Author: dweiss
Date: Sat Jun 30 08:59:36 2012
New Revision: 1355667

URL: http://svn.apache.org/viewvc?rev=1355667&view=rev
Log:
LUCENE-4160: don't take into account global tests.iters in this test.

Modified:
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/util/TestMaxFailuresRule.java
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestSameRandomnessLocalePassedOrNot.java

Modified: lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/util/TestMaxFailuresRule.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/util/TestMaxFailuresRule.java?rev=1355667&r1=1355666&r2=1355667&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/util/TestMaxFailuresRule.java (original)
+++ lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/util/TestMaxFailuresRule.java Sat Jun 30 08:59:36 2012
@@ -20,21 +20,26 @@ package org.apache.lucene.util;
 import org.apache.lucene.util.junitcompat.WithNestedTests;
 import org.junit.Assert;
 import org.junit.Ignore;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.JUnitCore;
 import org.junit.runner.Result;
 import org.junit.runner.notification.Failure;
 import org.junit.runner.notification.RunListener;
 
+import com.carrotsearch.randomizedtesting.SysGlobals;
 import com.carrotsearch.randomizedtesting.annotations.Repeat;
 import com.carrotsearch.randomizedtesting.rules.SystemPropertiesInvariantRule;
+import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;
 
 /**
  * @see TestRuleIgnoreAfterMaxFailures
  * @see SystemPropertiesInvariantRule
  */
-@Ignore("DW: Check why this test doesn't pass from time to time.")
 public class TestMaxFailuresRule extends WithNestedTests {
+  @Rule
+  public SystemPropertiesRestoreRule restoreSysProps = new SystemPropertiesRestoreRule();
+
   public TestMaxFailuresRule() {
     super(true);
   }
@@ -50,6 +55,7 @@ public class TestMaxFailuresRule extends
   public void testMaxFailures() {
     int maxFailures = LuceneTestCase.ignoreAfterMaxFailures.maxFailures;
     int failuresSoFar = LuceneTestCase.ignoreAfterMaxFailures.failuresSoFar;
+    System.clearProperty(SysGlobals.SYSPROP_ITERATIONS());
     try {
       LuceneTestCase.ignoreAfterMaxFailures.maxFailures = 2;
       LuceneTestCase.ignoreAfterMaxFailures.failuresSoFar = 0;

Modified: lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestSameRandomnessLocalePassedOrNot.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestSameRandomnessLocalePassedOrNot.java?rev=1355667&r1=1355666&r2=1355667&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestSameRandomnessLocalePassedOrNot.java (original)
+++ lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestSameRandomnessLocalePassedOrNot.java Sat Jun 30 08:59:36 2012
@@ -39,7 +39,7 @@ public class TestSameRandomnessLocalePas
     RuleChain.outerRule(new SystemPropertiesRestoreRule());
 
   public TestSameRandomnessLocalePassedOrNot() {
-    super(false);
+    super(true);
   }
   
   public static class Nested extends WithNestedTests.AbstractNestedTest {